comparison util/sasl.lua @ 5866:10a16fdebe2c

Merge 0.10->trunk
author Matthew Wild <mwild1@gmail.com>
date Thu, 10 Oct 2013 22:27:01 +0100
parents abcbaf7f2e8e
children f9e108f7db21
comparison
equal deleted inserted replaced
5861:c3ee62b3bdfe 5866:10a16fdebe2c
16 local t_insert = table.insert; 16 local t_insert = table.insert;
17 local type = type 17 local type = type
18 local setmetatable = setmetatable; 18 local setmetatable = setmetatable;
19 local assert = assert; 19 local assert = assert;
20 local require = require; 20 local require = require;
21 local print = print
22 21
23 module "sasl" 22 module "sasl"
24 23
25 --[[ 24 --[[
26 Authentication Backend Prototypes: 25 Authentication Backend Prototypes:
46 local mechanisms = {}; 45 local mechanisms = {};
47 local backend_mechanism = {}; 46 local backend_mechanism = {};
48 local mechanism_channelbindings = {}; 47 local mechanism_channelbindings = {};
49 48
50 -- register a new SASL mechanims 49 -- register a new SASL mechanims
51 local function registerMechanism(name, backends, f, cb_backends) 50 function registerMechanism(name, backends, f, cb_backends)
52 assert(type(name) == "string", "Parameter name MUST be a string."); 51 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."); 52 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."); 53 assert(type(f) == "function", "Parameter f MUST be a function.");
55 if cb_backends then assert(type(cb_backends) == "table"); end 54 if cb_backends then assert(type(cb_backends) == "table"); end
56 mechanisms[name] = f 55 mechanisms[name] = f