# HG changeset patch # User Tobias Markmann # Date 1295279421 -3600 # Node ID aa4bdabd3c0fee91b208c773428b0d750c91f0e8 # Parent ae48bf828f21ad93d2bfc3548a6a16bf81d52f31 util.sasl: New method to add channel binding handler to a SASL instance. diff -r ae48bf828f21 -r aa4bdabd3c0f util/sasl.lua --- 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)