Diff

plugins/mod_compression.lua @ 6358:55fda5deb5d5

mod_compression: Handle compression setup errors by logging a warning about it (fixes #408)
author Kim Alvefur <zash@zash.se>
date Tue, 26 Aug 2014 12:19:27 +0200
parent 6040:b3b1c9da38fb
child 6367:769a3577dd85
line wrap: on
line diff
--- 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;