From b54b2fd0bd56836ba3d2baa3293b0cddaf95bd08 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 11 May 2014 18:22:17 +0200 Subject: mod_admin_telnet: Send NUL byte as keepalive on read timeouts --- plugins/mod_admin_telnet.lua | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'plugins') diff --git a/plugins/mod_admin_telnet.lua b/plugins/mod_admin_telnet.lua index 71dfa300..6e912ea0 100644 --- a/plugins/mod_admin_telnet.lua +++ b/plugins/mod_admin_telnet.lua @@ -154,6 +154,14 @@ function console_listener.onincoming(conn, data) 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 -- cgit v1.2.3