Comparison

plugins/mod_saslauth.lua @ 2646:064efb684aff

mod_saslauth: Correct syntax for gracefully handling a missing cyrussasl library
author Matthew Wild <mwild1@gmail.com>
date Mon, 15 Feb 2010 22:56:15 +0000
parent 2642:333d7e2033b2
child 2647:0ddb3c4dc9d1
comparison
equal deleted inserted replaced
2645:625d02b2a1a0 2646:064efb684aff
34 local xmlns_bind ='urn:ietf:params:xml:ns:xmpp-bind'; 34 local xmlns_bind ='urn:ietf:params:xml:ns:xmpp-bind';
35 local xmlns_stanzas ='urn:ietf:params:xml:ns:xmpp-stanzas'; 35 local xmlns_stanzas ='urn:ietf:params:xml:ns:xmpp-stanzas';
36 36
37 local new_sasl; 37 local new_sasl;
38 if sasl_backend == "cyrus" then 38 if sasl_backend == "cyrus" then
39 local cyrus, err = pcall(require, "util.sasl_cyrus"); 39 local ok, cyrus = pcall(require, "util.sasl_cyrus");
40 if cyrus then 40 if ok then
41 local cyrus_new = cyrus.new; 41 local cyrus_new = cyrus.new;
42 new_sasl = function(realm) 42 new_sasl = function(realm)
43 return cyrus_new(realm, module:get_option("cyrus_service_name") or "xmpp"); 43 return cyrus_new(realm, module:get_option("cyrus_service_name") or "xmpp");
44 end 44 end
45 else 45 else