Mercurial > prosody-hg
diff util/sasl.lua @ 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 | 40c16475194e |
| children | 1b0c7e7c6be8 |
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)
