aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2010-03-12 18:41:05 +0100
committerTobias Markmann <tm@ayena.de>2010-03-12 18:41:05 +0100
commitb05ccd7b3affed026faf4b492d91af972f5ae8ac (patch)
tree9dd7b38690fed8b235977def984797ba62ac50c7 /util
parent3a972b1742c28b7ef9cb5f76ed3bc69f752b5899 (diff)
parent456cd9c62a173637f18d2c613e3514919369ad90 (diff)
downloadprosody-b05ccd7b3affed026faf4b492d91af972f5ae8ac.tar.gz
prosody-b05ccd7b3affed026faf4b492d91af972f5ae8ac.zip
Merge with tip.
Diffstat (limited to 'util')
-rw-r--r--util/sasl.lua2
-rw-r--r--util/sasl_cyrus.lua1
-rw-r--r--util/stanza.lua6
3 files changed, 5 insertions, 4 deletions
diff --git a/util/sasl.lua b/util/sasl.lua
index 4337f47a..306acc0c 100644
--- a/util/sasl.lua
+++ b/util/sasl.lua
@@ -122,7 +122,7 @@ function method:process(message)
end
-- load the mechanisms
-load_mechs = {"plain", "digest-md5", "anonymous", "scram"}
+local load_mechs = {"plain", "digest-md5", "anonymous", "scram"}
for _, mech in ipairs(load_mechs) do
local name = "util.sasl."..mech;
local m = require(name);
diff --git a/util/sasl_cyrus.lua b/util/sasl_cyrus.lua
index 57c6ba3c..980af598 100644
--- a/util/sasl_cyrus.lua
+++ b/util/sasl_cyrus.lua
@@ -87,6 +87,7 @@ end
-- select a mechanism to use
function method:select(mechanism)
self.mechanism = mechanism;
+ if not self.mechs then self:mechanisms(); end
return self.mechs[mechanism];
end
diff --git a/util/stanza.lua b/util/stanza.lua
index 065888d0..ad982d42 100644
--- a/util/stanza.lua
+++ b/util/stanza.lua
@@ -247,14 +247,14 @@ function deserialize(stanza)
for i=1,#attr do attr[i] = nil; end
local attrx = {};
for att in pairs(attr) do
- if s_find(att, "|", 1, true) and not s_find(k, "\1", 1, true) then
- local ns,na = s_match(k, "^([^|]+)|(.+)$");
+ if s_find(att, "|", 1, true) and not s_find(att, "\1", 1, true) then
+ local ns,na = s_match(att, "^([^|]+)|(.+)$");
attrx[ns.."\1"..na] = attr[att];
attr[att] = nil;
end
end
for a,v in pairs(attrx) do
- attr[x] = v;
+ attr[a] = v;
end
setmetatable(stanza, stanza_mt);
for _, child in ipairs(stanza) do