aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2009-11-29 22:02:21 +0100
committerTobias Markmann <tm@ayena.de>2009-11-29 22:02:21 +0100
commitb1743dfea11540cdf60fa26b560318f4a4b4fe84 (patch)
tree7c527c704750d39aea260824f46435c747f20eb5 /plugins
parentf91009f78a46ad74aa62ff487fa297c06a1ae6a3 (diff)
downloadprosody-b1743dfea11540cdf60fa26b560318f4a4b4fe84.tar.gz
prosody-b1743dfea11540cdf60fa26b560318f4a4b4fe84.zip
mod_compression: Prepare activating of compression on s2s.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_compression.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/mod_compression.lua b/plugins/mod_compression.lua
index 096ed0d5..72573b93 100644
--- a/plugins/mod_compression.lua
+++ b/plugins/mod_compression.lua
@@ -8,7 +8,6 @@
local st = require "util.stanza";
local zlib = require "zlib";
local pcall = pcall;
-
local xmlns_compression_feature = "http://jabber.org/features/compress"
local xmlns_compression_protocol = "http://jabber.org/protocol/compress"
local xmlns_stream = "http://etherx.jabber.org/streams";
@@ -55,7 +54,7 @@ module:hook_stanza(xmlns_stream, "features",
for a in comp_st:children() do
local algorithm = a[1]
if algorithm == "zlib" then
- session.sends2s(st.stanza("compress", {xmlns=xmlns_compression_protocol}):text("zlib"))
+ session.sends2s(st.stanza("compress", {xmlns=xmlns_compression_protocol}):tag("method"):text("zlib"))
session.log("info", "Enabled compression using zlib.")
return true;
end
@@ -67,6 +66,12 @@ module:hook_stanza(xmlns_stream, "features",
, 250);
-- TODO Support compression on S2S level too.
+module:add_handler({"s2sout_unauthed", "s2sout"}, "compressed", xmlns_compression_protocol,
+ function(session ,stanza)
+ session.log("debug", "Activating compression...")
+ end
+);
+
module:add_handler({"c2s_unauthed", "c2s", "s2sin_unauthed", "s2sin"}, "compress", xmlns_compression_protocol,
function(session, stanza)
-- fail if we are already compressed