aboutsummaryrefslogtreecommitdiffstats
path: root/util/sasl.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-11-10 05:42:32 +0100
committerKim Alvefur <zash@zash.se>2017-11-10 05:42:32 +0100
commit1438a3884507b709cba08691d329b0cf137f4bd4 (patch)
tree9186c5db947b241b5590afab18bd6e720f95046a /util/sasl.lua
parent8962abd55b75a572b0e5821f11cd3342e09b113b (diff)
downloadprosody-1438a3884507b709cba08691d329b0cf137f4bd4.tar.gz
prosody-1438a3884507b709cba08691d329b0cf137f4bd4.zip
util: Various minor changes to please [luacheck]
Diffstat (limited to 'util/sasl.lua')
-rw-r--r--util/sasl.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/util/sasl.lua b/util/sasl.lua
index 5845f34a..3c5b8be0 100644
--- a/util/sasl.lua
+++ b/util/sasl.lua
@@ -42,7 +42,7 @@ Example:
local method = {};
method.__index = method;
-local mechanisms = {};
+local registered_mechanisms = {};
local backend_mechanism = {};
local mechanism_channelbindings = {};
@@ -52,7 +52,7 @@ local function registerMechanism(name, backends, f, cb_backends)
assert(type(backends) == "string" or type(backends) == "table", "Parameter backends MUST be either a string or a table.");
assert(type(f) == "function", "Parameter f MUST be a function.");
if cb_backends then assert(type(cb_backends) == "table"); end
- mechanisms[name] = f
+ registered_mechanisms[name] = f
if cb_backends then
mechanism_channelbindings[name] = {};
for _, cb_name in ipairs(cb_backends) do
@@ -70,7 +70,7 @@ local function new(realm, profile)
local mechanisms = profile.mechanisms;
if not mechanisms then
mechanisms = {};
- for backend, f in pairs(profile) do
+ for backend in pairs(profile) do
if backend_mechanism[backend] then
for _, mechanism in ipairs(backend_mechanism[backend]) do
mechanisms[mechanism] = true;
@@ -128,7 +128,7 @@ end
-- feed new messages to process into the library
function method:process(message)
--if message == "" or message == nil then return "failure", "malformed-request" end
- return mechanisms[self.selected](self, message);
+ return registered_mechanisms[self.selected](self, message);
end
-- load the mechanisms