aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_compression.lua
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/mod_compression.lua')
-rw-r--r--plugins/mod_compression.lua8
1 files changed, 4 insertions, 4 deletions
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;