Diff

plugins/mod_admin_telnet.lua @ 6169:cb15eac75b50

mod_admin_telnet: Send NUL byte as keepalive on read timeouts
author Kim Alvefur <zash@zash.se>
date Sun, 11 May 2014 18:22:17 +0200
parent 6067:dab7ad6fa23c
child 6170:1dff425ffe84
line wrap: on
line diff
--- a/plugins/mod_admin_telnet.lua	Fri May 09 23:28:09 2014 +0200
+++ b/plugins/mod_admin_telnet.lua	Sun May 11 18:22:17 2014 +0200
@@ -154,6 +154,14 @@
 	session.partial_data = data:match("[^\n]+$");
 end
 
+function console_listener.onreadtimeout(conn)
+	local session = sessions[conn];
+	if session then
+		session.send("\0");
+		return true;
+	end
+end
+
 function console_listener.ondisconnect(conn, err)
 	local session = sessions[conn];
 	if session then