# HG changeset patch # User Kim Alvefur # Date 1409048367 -7200 # Node ID 55fda5deb5d5dfb4bb3f0a63356f0e62b90c1e87 # Parent ccae56e34956c28b8e8b76d598ba83fddc086e61 mod_compression: Handle compression setup errors by logging a warning about it (fixes #408) diff -r ccae56e34956 -r 55fda5deb5d5 plugins/mod_compression.lua --- a/plugins/mod_compression.lua Tue Aug 26 12:02:41 2014 +0200 +++ b/plugins/mod_compression.lua Tue Aug 26 12:19:27 2014 +0200 @@ -147,6 +147,12 @@ end end); +module:hook("stanza/http://jabber.org/protocol/compress:failure", function(event) + local err = event.stanza:get_child(); + (event.origin.log or module._log)("warn", "Compression setup failed (%s)", err and err.name or "unknown reason"); + return true; +end); + module:hook("stanza/http://jabber.org/protocol/compress:compress", function(event) local session, stanza = event.origin, event.stanza;