Diff

plugins/mod_s2s/mod_s2s.lua @ 5638:c5b7f4858014

mod_c2s, mod_c2s: Send a whitespace on read timeout, to prod TCP into detecting if the connection died
author Kim Alvefur <zash@zash.se>
date Thu, 30 May 2013 14:32:40 +0200
parent 5636:d323932ecf18
child 5661:f226a0d23e85
line wrap: on
line diff
--- a/plugins/mod_s2s/mod_s2s.lua	Tue May 28 18:32:51 2013 +0200
+++ b/plugins/mod_s2s/mod_s2s.lua	Thu May 30 14:32:40 2013 +0200
@@ -624,6 +624,13 @@
 	end
 end
 
+function listener.onreadtimeout(conn)
+	local session = sessions[conn];
+	if session then
+		return session.sends2s(' ');
+	end
+end
+
 function listener.register_outgoing(conn, session)
 	session.direction = "outgoing";
 	sessions[conn] = session;