Software /
code /
prosody
Comparison
util/sasl.lua @ 3364:6a5d77924949
util.sasl: Use the proper session-specific table of mechanisms when selecting a mechanism, and not the global table.
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Wed, 14 Jul 2010 20:05:25 +0500 |
parent | 3363:a4bb658d3fcb |
child | 3365:32dc830d976c |
comparison
equal
deleted
inserted
replaced
3363:a4bb658d3fcb | 3364:6a5d77924949 |
---|---|
96 mechanisms[mechanism] = true; | 96 mechanisms[mechanism] = true; |
97 end | 97 end |
98 end | 98 end |
99 end | 99 end |
100 end | 100 end |
101 self["possible_mechanisms"] = mechanisms; | 101 self.mechs = mechanisms; |
102 return mechanisms; | 102 return mechanisms; |
103 end | 103 end |
104 | 104 |
105 -- select a mechanism to use | 105 -- select a mechanism to use |
106 function method:select(mechanism) | 106 function method:select(mechanism) |
107 if self.mech_i then | 107 if self.mech_i then |
108 return false; | 108 return false; |
109 end | 109 end |
110 | 110 |
111 self.mech_i = mechanisms[mechanism]; | 111 self.mech_i = self.mechs[mechanism]; |
112 return (self.mech_i ~= nil); | 112 return (self.mech_i ~= nil); |
113 end | 113 end |
114 | 114 |
115 -- feed new messages to process into the library | 115 -- feed new messages to process into the library |
116 function method:process(message) | 116 function method:process(message) |