Comparison

plugins/mod_compression.lua @ 1728:cb4c94b47d53

mod_compression: Fixed: Starting compression only worked before auth
author Waqas Hussain <waqas20@gmail.com>
date Wed, 02 Sep 2009 19:22:06 +0500
parent 1719:cf103398e643
child 2279:49bc4c7bdef8
comparison
equal deleted inserted replaced
1727:cbdc7bf61e0f 1728:cb4c94b47d53
33 end 33 end
34 end 34 end
35 ); 35 );
36 36
37 -- TODO Support compression on S2S level too. 37 -- TODO Support compression on S2S level too.
38 module:add_handler({"c2s_unauthed", "c2s_authed"}, "compress", xmlns_compression_protocol, 38 module:add_handler({"c2s_unauthed", "c2s"}, "compress", xmlns_compression_protocol,
39 function(session, stanza) 39 function(session, stanza)
40 -- fail if we are already compressed 40 -- fail if we are already compressed
41 if session.compressed then 41 if session.compressed then
42 local error_st = st.stanza("failure", {xmlns=xmlns_compression_protocol}):tag("unsupported-method"); 42 local error_st = st.stanza("failure", {xmlns=xmlns_compression_protocol}):tag("unsupported-method");
43 session.send(error_st); 43 session.send(error_st);