Software /
code /
prosody
Diff
plugins/mod_compression.lua @ 6040:b3b1c9da38fb
mod_compression: Only allow compression on authenticated streams
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 18 Feb 2014 20:03:12 +0100 |
parent | 5535:0df0afc041d7 |
child | 6054:7a5ddbaf758d |
child | 6358:55fda5deb5d5 |
line wrap: on
line diff
--- a/plugins/mod_compression.lua Sat Mar 22 12:02:11 2014 +0100 +++ b/plugins/mod_compression.lua Tue Feb 18 20:03:12 2014 +0100 @@ -126,7 +126,7 @@ module:hook("stanza/http://jabber.org/protocol/compress:compressed", function(event) local session = event.origin; - if session.type == "s2sout_unauthed" or session.type == "s2sout" then + if session.type == "s2sout" then session.log("debug", "Activating compression...") -- create deflate and inflate streams local deflate_stream = get_deflate_stream(session); @@ -150,7 +150,7 @@ module:hook("stanza/http://jabber.org/protocol/compress:compress", function(event) local session, stanza = event.origin, event.stanza; - if session.type == "c2s" or session.type == "s2sin" or session.type == "c2s_unauthed" or session.type == "s2sin_unauthed" then + if session.type == "c2s" or session.type == "s2sin" then -- fail if we are already compressed if session.compressed then local error_st = st.stanza("failure", {xmlns=xmlns_compression_protocol}):tag("setup-failed");