Diff

plugins/mod_c2s.lua @ 5231:4f9135e6c2f9

Merge 0.9->trunk
author Kim Alvefur <zash@zash.se>
date Sun, 09 Dec 2012 12:39:49 +0100
parent 5228:edabb34417b7
child 5281:815c689f85ad
line wrap: on
line diff
--- a/plugins/mod_c2s.lua	Tue Dec 04 20:11:41 2012 +0000
+++ b/plugins/mod_c2s.lua	Sun Dec 09 12:39:49 2012 +0100
@@ -66,6 +66,14 @@
 	-- 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 @@
 	-- 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