Comparison

plugins/mod_compression.lua @ 6368:bd0c8b361589

Merge 0.10->trunk
author Matthew Wild <mwild1@gmail.com>
date Thu, 28 Aug 2014 12:05:18 +0100
parent 6367:769a3577dd85
child 6984:0f633160464c
comparison
equal deleted inserted replaced
6354:bbb4a82db32e 6368:bd0c8b361589
145 session.compressed = true; 145 session.compressed = true;
146 return true; 146 return true;
147 end 147 end
148 end); 148 end);
149 149
150 module:hook("stanza/http://jabber.org/protocol/compress:failure", function(event)
151 local err = event.stanza:get_child();
152 (event.origin.log or module._log)("warn", "Compression setup failed (%s)", err and err.name or "unknown reason");
153 return true;
154 end);
155
150 module:hook("stanza/http://jabber.org/protocol/compress:compress", function(event) 156 module:hook("stanza/http://jabber.org/protocol/compress:compress", function(event)
151 local session, stanza = event.origin, event.stanza; 157 local session, stanza = event.origin, event.stanza;
152 158
153 if session.type == "c2s" or session.type == "s2sin" then 159 if session.type == "c2s" or session.type == "s2sin" then
154 -- fail if we are already compressed 160 -- fail if we are already compressed