util/sasl_cyrus.lua

changeset 3365
32dc830d976c
parent 3363
a4bb658d3fcb
child 3366
a2a242321901
equal deleted inserted replaced
3364:6a5d77924949 3365:32dc830d976c
127 return {} 127 return {}
128 end 128 end
129 129
130 -- get a list of possible SASL mechanims to use 130 -- get a list of possible SASL mechanims to use
131 function method:mechanisms() 131 function method:mechanisms()
132 local mechanisms = {} 132 local mechanisms = self.mechs;
133 local cyrus_mechs = cyrussasl.listmech(self.cyrus, nil, "", " ", "") 133 if not mechanisms then
134 for w in s_gmatch(cyrus_mechs, "[^ ]+") do 134 mechanisms = {}
135 mechanisms[w] = true; 135 local cyrus_mechs = cyrussasl.listmech(self.cyrus, nil, "", " ", "")
136 for w in s_gmatch(cyrus_mechs, "[^ ]+") do
137 mechanisms[w] = true;
138 end
139 self.mechs = mechanisms
136 end 140 end
137 self.mechs = mechanisms
138 return mechanisms; 141 return mechanisms;
139 end 142 end
140 143
141 -- select a mechanism to use 144 -- select a mechanism to use
142 function method:select(mechanism) 145 function method:select(mechanism)

mercurial