Software /
code /
prosody
Comparison
plugins/mod_compression.lua @ 6367:769a3577dd85
Merge 0.9->0.10
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Thu, 28 Aug 2014 09:23:24 +0100 |
parent | 6058:1607b03356ed |
parent | 6358:55fda5deb5d5 |
child | 6984:0f633160464c |
comparison
equal
deleted
inserted
replaced
6355:c2d144d3f8dd | 6367:769a3577dd85 |
---|---|
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 |