--- a/plugins/mod_compression.lua Tue Mar 09 17:43:18 2010 +0500
+++ b/plugins/mod_compression.lua Tue Mar 09 17:52:18 2010 +0500
@@ -48,10 +48,6 @@
-- 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 @@
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;