17 mech = mech:get_text(); |
17 mech = mech:get_text(); |
18 stream:debug("Server offers %s", mech); |
18 stream:debug("Server offers %s", mech); |
19 offered[mech] = true; |
19 offered[mech] = true; |
20 if not mechanisms[mech] then |
20 if not mechanisms[mech] then |
21 local name = mech:match("[^-]+"); |
21 local name = mech:match("[^-]+"); |
22 local ok, impl = pcall(require, "util.sasl."..name:lower()); |
22 local ok, impl = pcall(require, "verse.util.sasl."..name:lower()); |
23 if ok then |
23 if ok then |
24 stream:debug("Loaded SASL %s module", name); |
24 stream:debug("Loaded SASL %s module", name); |
25 mechanisms[mech], preference[mech] = impl(stream, mech); |
25 mechanisms[mech], preference[mech] = impl(stream, mech); |
26 elseif not tostring(impl):match("not found") then |
26 elseif not tostring(impl):match("not found") then |
27 stream:debug("Loading failed: %s", tostring(impl)); |
27 stream:debug("Loading failed: %s", tostring(impl)); |