From 84ece3aca6b0d76a307acb47a4d0fc89c5eb3437 Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Tue, 9 Mar 2010 17:52:18 +0500 Subject: mod_compression: Don't tell client compression succeeded when it didn't. --- plugins/mod_compression.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'plugins') diff --git a/plugins/mod_compression.lua b/plugins/mod_compression.lua index 9ad0cbd4..e35430fd 100644 --- a/plugins/mod_compression.lua +++ b/plugins/mod_compression.lua @@ -48,10 +48,6 @@ module:add_handler({"c2s_unauthed", "c2s"}, "compress", xmlns_compression_protoc -- checking if the compression method is supported local method = stanza:child_with_name("method")[1]; if method == "zlib" then - session.log("info", method.." compression selected."); - session.send(st.stanza("compressed", {xmlns=xmlns_compression_protocol})); - session:reset_stream(); - -- create deflate and inflate streams local status, deflate_stream = pcall(zlib.deflate, compression_level); if status == false then @@ -71,6 +67,10 @@ module:add_handler({"c2s_unauthed", "c2s"}, "compress", xmlns_compression_protoc return end + session.log("info", method.." compression selected."); + session.send(st.stanza("compressed", {xmlns=xmlns_compression_protocol})); + session:reset_stream(); + -- setup compression for session.w local old_send = session.send; -- cgit v1.2.3