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 | b54b2fd0bd56836ba3d2baa3293b0cddaf95bd08 (patch) | |
tree | 9e15267c08ff8d9bdea5d920295d3580e3035643 /plugins | |
parent | 3cfe230bd0725c3c3cc3aacb97f11edf12da8305 (diff) | |
download | prosody-b54b2fd0bd56836ba3d2baa3293b0cddaf95bd08.tar.gz prosody-b54b2fd0bd56836ba3d2baa3293b0cddaf95bd08.zip |
mod_admin_telnet: Send NUL byte as keepalive on read timeouts
Diffstat (limited to 'plugins')
-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 |