Comparison

util/sasl.lua @ 2185:e92339c48ee6 sasl

Fail if mechanism has already been selected.
author Tobias Markmann <tm@ayena.de>
date Fri, 28 Aug 2009 22:03:11 +0200
parent 2184:0d1740f7b6e8
child 2186:1112871916eb
comparison
equal deleted inserted replaced
2184:0d1740f7b6e8 2185:e92339c48ee6
100 return array.collect(keys(mechanisms)); 100 return array.collect(keys(mechanisms));
101 end 101 end
102 102
103 -- select a mechanism to use 103 -- select a mechanism to use
104 function method:select(mechanism) 104 function method:select(mechanism)
105 if self.mech_i then
106 return false;
107 end
108
105 self.mech_i = mechanisms[mechanism] 109 self.mech_i = mechanisms[mechanism]
106 if self.mech_i == nil then 110 if self.mech_i == nil then
107 return false; 111 return false;
108 end 112 end
109 return true; 113 return true;