Software / code / verse
Comparison
plugins/sasl.lua @ 360:ac3940bad1bf
plugins.sasl: Store mechanisms with the correct name
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Thu, 18 Sep 2014 22:00:58 +0200 |
| parent | 358:a8f6fd6a70ed |
| child | 380:0891b4e27766 |
comparison
equal
deleted
inserted
replaced
| 359:a7aa761a436d | 360:ac3940bad1bf |
|---|---|
| 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 |