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