aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-03-09 17:52:18 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-03-09 17:52:18 +0500
commit84ece3aca6b0d76a307acb47a4d0fc89c5eb3437 (patch)
treef2cdd790b7355bd860b11a026c54ac836823f2b5 /plugins
parentcf224cd1a1f08dcf6ba48253fd60a2d148c613b3 (diff)
downloadprosody-84ece3aca6b0d76a307acb47a4d0fc89c5eb3437.tar.gz
prosody-84ece3aca6b0d76a307acb47a4d0fc89c5eb3437.zip
mod_compression: Don't tell client compression succeeded when it didn't.
Diffstat (limited to 'plugins')
-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;