Software /
code /
prosody
Changeset
5831:aa4bdabd3c0f
util.sasl: New method to add channel binding handler to a SASL instance.
author | Tobias Markmann <tm@ayena.de> |
---|---|
date | Mon, 17 Jan 2011 16:50:21 +0100 |
parents | 5830:ae48bf828f21 |
children | 5832:7d100d917243 |
files | util/sasl.lua |
diffstat | 1 files changed, 9 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/util/sasl.lua Mon Jan 17 16:50:21 2011 +0100 +++ b/util/sasl.lua Mon Jan 17 16:50:21 2011 +0100 @@ -70,6 +70,15 @@ 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)