Comparison

util/sasl.lua @ 4933:630cb694b364

util.sasl: Make registerMechanism a public function
author Matthew Wild <mwild1@gmail.com>
date Mon, 18 Jun 2012 16:57:46 +0100
parent 3986:671a660b20f9
child 5687:e879b53e9df8
comparison
equal deleted inserted replaced
4928:5211c11dd865 4933:630cb694b364
33 method.__index = method; 33 method.__index = method;
34 local mechanisms = {}; 34 local mechanisms = {};
35 local backend_mechanism = {}; 35 local backend_mechanism = {};
36 36
37 -- register a new SASL mechanims 37 -- register a new SASL mechanims
38 local function registerMechanism(name, backends, f) 38 function registerMechanism(name, backends, f)
39 assert(type(name) == "string", "Parameter name MUST be a string."); 39 assert(type(name) == "string", "Parameter name MUST be a string.");
40 assert(type(backends) == "string" or type(backends) == "table", "Parameter backends MUST be either a string or a table."); 40 assert(type(backends) == "string" or type(backends) == "table", "Parameter backends MUST be either a string or a table.");
41 assert(type(f) == "function", "Parameter f MUST be a function."); 41 assert(type(f) == "function", "Parameter f MUST be a function.");
42 mechanisms[name] = f 42 mechanisms[name] = f
43 for _, backend_name in ipairs(backends) do 43 for _, backend_name in ipairs(backends) do