diff options
author | Kim Alvefur <zash@zash.se> | 2014-05-11 18:22:17 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2014-05-11 18:22:17 +0200 |
commit | 929b010f42b2f0cdee194d0c282e4246dfd7083b (patch) | |
tree | 9e15267c08ff8d9bdea5d920295d3580e3035643 | |
parent | cb8d6cd008a01a8fc7427c9489a2366e17e88a62 (diff) | |
download | prosody-929b010f42b2f0cdee194d0c282e4246dfd7083b.tar.gz prosody-929b010f42b2f0cdee194d0c282e4246dfd7083b.zip |
mod_admin_telnet: Send NUL byte as keepalive on read timeouts
-rw-r--r-- | plugins/mod_admin_telnet.lua | 8 |
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 |