aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-07-14 20:21:51 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-07-14 20:21:51 +0500
commit74f1fca10ea47b63e2a66ff0aeee83cb4b49ee1e (patch)
tree7d396676238e2dc010e947af0b9da048bcc95bee
parent81c3a58d1fed9f0e5713d005181b871c12843fd3 (diff)
downloadprosody-74f1fca10ea47b63e2a66ff0aeee83cb4b49ee1e.tar.gz
prosody-74f1fca10ea47b63e2a66ff0aeee83cb4b49ee1e.zip
util.sasl, util.sasl_cyrus: Use method:mechanisms() in method:select(), instead of using the mechanisms list directly (fixes a traceback).
-rw-r--r--util/sasl.lua2
-rw-r--r--util/sasl_cyrus.lua3
2 files changed, 2 insertions, 3 deletions
diff --git a/util/sasl.lua b/util/sasl.lua
index 8f91f7b5..ab8b78a8 100644
--- a/util/sasl.lua
+++ b/util/sasl.lua
@@ -111,7 +111,7 @@ function method:select(mechanism)
return false;
end
- self.mech_i = self.mechs[mechanism];
+ self.mech_i = mechanisms[self.mechanisms()[mechanism] and mechanism];
return (self.mech_i ~= nil);
end
diff --git a/util/sasl_cyrus.lua b/util/sasl_cyrus.lua
index 5178f7cd..0676bcf7 100644
--- a/util/sasl_cyrus.lua
+++ b/util/sasl_cyrus.lua
@@ -144,8 +144,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];
+ return self.mechanisms()[mechanism];
end
-- feed new messages to process into the library