aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_c2s.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2012-12-09 12:39:49 +0100
committerKim Alvefur <zash@zash.se>2012-12-09 12:39:49 +0100
commit35cb12c554d8b5ee7134a0e15556e91a81a093b4 (patch)
tree03956a8a9247babc607ab26b998b387ff6caf3cd /plugins/mod_c2s.lua
parent25f5253ac069dccbc28d4495fc493b5667f3607b (diff)
parent329ee389c5fdea1e5cab9385accf7fd5fe80c7dc (diff)
downloadprosody-35cb12c554d8b5ee7134a0e15556e91a81a093b4.tar.gz
prosody-35cb12c554d8b5ee7134a0e15556e91a81a093b4.zip
Merge 0.9->trunk
Diffstat (limited to 'plugins/mod_c2s.lua')
-rw-r--r--plugins/mod_c2s.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/plugins/mod_c2s.lua b/plugins/mod_c2s.lua
index dabed021..72085113 100644
--- a/plugins/mod_c2s.lua
+++ b/plugins/mod_c2s.lua
@@ -66,6 +66,14 @@ function stream_callbacks.streamopened(session, attr)
-- since we now have a new stream header, session is secured
if session.secure == false then
session.secure = true;
+
+ -- Check if TLS compression is used
+ local sock = session.conn:socket();
+ if sock.info then
+ session.compressed = sock:info"compression";
+ elseif sock.compression then
+ session.compressed = sock:compression(); --COMPAT mw/luasec-hg
+ end
end
local features = st.stanza("stream:features");
@@ -189,6 +197,14 @@ function listener.onconnect(conn)
-- Client is using legacy SSL (otherwise mod_tls sets this flag)
if conn:ssl() then
session.secure = true;
+
+ -- Check if TLS compression is used
+ local sock = conn:socket();
+ if sock.info then
+ session.compressed = sock:info"compression";
+ elseif sock.compression then
+ session.compressed = sock:compression(); --COMPAT mw/luasec-hg
+ end
end
if opt_keepalives then