aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_compression.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-06-10 16:47:17 +0100
committerMatthew Wild <mwild1@gmail.com>2010-06-10 16:47:17 +0100
commit0929b61dbc2fc5094e041ad138bdd081b894105c (patch)
tree85ebca6903e2dab7794eae5bbc9dafee50a4d7a3 /plugins/mod_compression.lua
parent816598f46e46a3e7eb45ab83b174c312ee7c6def (diff)
downloadprosody-0929b61dbc2fc5094e041ad138bdd081b894105c.tar.gz
prosody-0929b61dbc2fc5094e041ad138bdd081b894105c.zip
mod_compression: Move logging of compression/decompression errors to before the closing of the stream, to make logs a bit easier to follow
Diffstat (limited to 'plugins/mod_compression.lua')
-rw-r--r--plugins/mod_compression.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/mod_compression.lua b/plugins/mod_compression.lua
index 0bee5b12..9edee44a 100644
--- a/plugins/mod_compression.lua
+++ b/plugins/mod_compression.lua
@@ -98,12 +98,12 @@ local function setup_compression(session, deflate_stream)
add_filter(session, "bytes/out", function(t)
local status, compressed, eof = pcall(deflate_stream, tostring(t), 'sync');
if status == false then
+ module:log("warn", "%s", tostring(compressed));
session:close({
condition = "undefined-condition";
text = compressed;
extra = st.stanza("failure", {xmlns="http://jabber.org/protocol/compress"}):tag("processing-failed");
});
- module:log("warn", "%s", tostring(compressed));
return;
end
return compressed;
@@ -115,12 +115,12 @@ local function setup_decompression(session, inflate_stream)
add_filter(session, "bytes/in", function(data)
local status, decompressed, eof = pcall(inflate_stream, data);
if status == false then
+ module:log("warn", "%s", tostring(decompressed));
session:close({
condition = "undefined-condition";
text = decompressed;
extra = st.stanza("failure", {xmlns="http://jabber.org/protocol/compress"}):tag("processing-failed");
});
- module:log("warn", "%s", tostring(decompressed));
return;
end
return decompressed;