Comparison

util/sasl.lua @ 5862:7e83c8448cd6

util.sasl: Make registerMechanism a public function (again)
author Waqas Hussain <waqas20@gmail.com>
date Mon, 07 Oct 2013 17:57:06 -0400
parent 5843:fb6573e191cf
child 5863:abcbaf7f2e8e
comparison
equal deleted inserted replaced
5860:87e2fafba5df 5862:7e83c8448cd6
46 local mechanisms = {}; 46 local mechanisms = {};
47 local backend_mechanism = {}; 47 local backend_mechanism = {};
48 local mechanism_channelbindings = {}; 48 local mechanism_channelbindings = {};
49 49
50 -- register a new SASL mechanims 50 -- register a new SASL mechanims
51 local function registerMechanism(name, backends, f, cb_backends) 51 function registerMechanism(name, backends, f, cb_backends)
52 assert(type(name) == "string", "Parameter name MUST be a string."); 52 assert(type(name) == "string", "Parameter name MUST be a string.");
53 assert(type(backends) == "string" or type(backends) == "table", "Parameter backends MUST be either a string or a table."); 53 assert(type(backends) == "string" or type(backends) == "table", "Parameter backends MUST be either a string or a table.");
54 assert(type(f) == "function", "Parameter f MUST be a function."); 54 assert(type(f) == "function", "Parameter f MUST be a function.");
55 if cb_backends then assert(type(cb_backends) == "table"); end 55 if cb_backends then assert(type(cb_backends) == "table"); end
56 mechanisms[name] = f 56 mechanisms[name] = f