plugins/sasl.lua

changeset 456
6a65142052c8
parent 395
e86144a4eaa1
child 467
8e6a7a5e70b3
equal deleted inserted replaced
455:753d6983dc45 456:6a65142052c8
30 local supported = {}; -- by the server 30 local supported = {}; -- by the server
31 for mech in pairs(mechanisms) do 31 for mech in pairs(mechanisms) do
32 table.insert(supported, mech); 32 table.insert(supported, mech);
33 end 33 end
34 if not supported[1] then 34 if not supported[1] then
35 stream:event("authentication-failure", { condition = "no-supported-sasl-mechanisms" }); 35 stream:event("authentication-failure", { condition = "no-supported-sasl-mechanisms", mechanisms = mechanisms });
36 stream:close(); 36 stream:close();
37 return; 37 return;
38 end 38 end
39 table.sort(supported, function (a, b) return preference[a] > preference[b]; end); 39 table.sort(supported, function (a, b) return preference[a] > preference[b]; end);
40 local mechanism, initial_data = supported[1]; 40 local mechanism, initial_data = supported[1];

mercurial