Diff

plugins/mod_s2s/mod_s2s.lua @ 5173:b22d24b5a89a

mod_s2s: Detect TLS compression
author Kim Alvefur <zash@zash.se>
date Wed, 24 Oct 2012 19:05:56 +0200
parent 5120:bcabea740c00
child 5274:0d08c0965824
line wrap: on
line diff
--- a/plugins/mod_s2s/mod_s2s.lua	Sun Oct 14 21:04:46 2012 +0200
+++ b/plugins/mod_s2s/mod_s2s.lua	Wed Oct 24 19:05:56 2012 +0200
@@ -184,6 +184,14 @@
 	-- TODO: Rename session.secure to session.encrypted
 	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
 
 	if session.direction == "incoming" then