aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2014-05-11 18:22:17 +0200
committerKim Alvefur <zash@zash.se>2014-05-11 18:22:17 +0200
commit929b010f42b2f0cdee194d0c282e4246dfd7083b (patch)
tree9e15267c08ff8d9bdea5d920295d3580e3035643
parentcb8d6cd008a01a8fc7427c9489a2366e17e88a62 (diff)
downloadprosody-929b010f42b2f0cdee194d0c282e4246dfd7083b.tar.gz
prosody-929b010f42b2f0cdee194d0c282e4246dfd7083b.zip
mod_admin_telnet: Send NUL byte as keepalive on read timeouts
-rw-r--r--plugins/mod_admin_telnet.lua8
1 files changed, 8 insertions, 0 deletions
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