diff options
author | Kim Alvefur <zash@zash.se> | 2012-12-09 11:50:09 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2012-12-09 11:50:09 +0100 |
commit | 233b38c3b0175eddbefb12ca5f485fea3189fe2a (patch) | |
tree | a3bd256357f053f2e5c2c8b36326cbefcc0c42d6 /plugins/mod_c2s.lua | |
parent | 440837480dbdbfb36123659cf5e2b4e2a0e63a2f (diff) | |
download | prosody-233b38c3b0175eddbefb12ca5f485fea3189fe2a.tar.gz prosody-233b38c3b0175eddbefb12ca5f485fea3189fe2a.zip |
mod_c2s: Check if TLS compression is used
Diffstat (limited to 'plugins/mod_c2s.lua')
-rw-r--r-- | plugins/mod_c2s.lua | 16 |
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 |