Comparison

plugins/mod_saslauth.lua @ 3548:cd8d1cacc65b

mod_saslauth: Handle SASL <abort/> properly.
author Waqas Hussain <waqas20@gmail.com>
date Tue, 02 Nov 2010 15:07:25 +0500
parent 3535:b953b0c0f203
child 3551:4fba723ab235
comparison
equal deleted inserted replaced
3547:3242e70f1058 3548:cd8d1cacc65b
117 session.send(s); 117 session.send(s);
118 return true; 118 return true;
119 end 119 end
120 120
121 module:hook("stanza/urn:ietf:params:xml:ns:xmpp-sasl:auth", sasl_handler); 121 module:hook("stanza/urn:ietf:params:xml:ns:xmpp-sasl:auth", sasl_handler);
122 module:hook("stanza/urn:ietf:params:xml:ns:xmpp-sasl:abort", sasl_handler);
123 module:hook("stanza/urn:ietf:params:xml:ns:xmpp-sasl:response", sasl_handler); 122 module:hook("stanza/urn:ietf:params:xml:ns:xmpp-sasl:response", sasl_handler);
123 module:hook("stanza/urn:ietf:params:xml:ns:xmpp-sasl:abort", function(event)
124 local session = event.origin;
125 session.sasl_handler = nil;
126 session.send(build_reply("failure", "aborted"));
127 return true;
128 end);
124 129
125 local mechanisms_attr = { xmlns='urn:ietf:params:xml:ns:xmpp-sasl' }; 130 local mechanisms_attr = { xmlns='urn:ietf:params:xml:ns:xmpp-sasl' };
126 local bind_attr = { xmlns='urn:ietf:params:xml:ns:xmpp-bind' }; 131 local bind_attr = { xmlns='urn:ietf:params:xml:ns:xmpp-bind' };
127 local xmpp_session_attr = { xmlns='urn:ietf:params:xml:ns:xmpp-session' }; 132 local xmpp_session_attr = { xmlns='urn:ietf:params:xml:ns:xmpp-session' };
128 module:hook("stream-features", function(event) 133 module:hook("stream-features", function(event)