projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
58b406b
)
util.sasl: New method to add channel binding handler to a SASL instance.
author
Tobias Markmann
<tm@ayena.de>
Mon, 17 Jan 2011 15:50:21 +0000
(16:50 +0100)
committer
Tobias Markmann
<tm@ayena.de>
Mon, 17 Jan 2011 15:50:21 +0000
(16:50 +0100)
util/sasl.lua
patch
|
blob
|
history
diff --git
a/util/sasl.lua
b/util/sasl.lua
index 37a234c9130390f721e73d17e4b43afb827be48e..cd0a1d64233ddf83dab855abc0ce17466590198f 100644
(file)
--- a/
util/sasl.lua
+++ b/
util/sasl.lua
@@
-70,6
+70,15
@@
function new(realm, profile)
return setmetatable({ profile = profile, realm = realm, mechs = mechanisms }, method);
end
+-- add a channel binding handler
+function method:add_cb_handler(name, f)
+ if type(self.profile.cb) ~= "table" then
+ self.profile.cb = {};
+ end
+ self.profile.cb[name] = f;
+ return self;
+end
+
-- get a fresh clone with the same realm and profile
function method:clean_clone()
return new(self.realm, self.profile)