Changeset

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
parents 6167:5af7fe1014db
children 6170:1dff425ffe84
files plugins/mod_admin_telnet.lua
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
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