Software /
code /
prosody
Comparison
plugins/mod_admin_telnet.lua @ 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 |
parent | 6067:dab7ad6fa23c |
child | 6170:1dff425ffe84 |
comparison
equal
deleted
inserted
replaced
6167:5af7fe1014db | 6169:cb15eac75b50 |
---|---|
150 if session.closed then return end | 150 if session.closed then return end |
151 console:process_line(session, line); | 151 console:process_line(session, line); |
152 session.send(string.char(0)); | 152 session.send(string.char(0)); |
153 end | 153 end |
154 session.partial_data = data:match("[^\n]+$"); | 154 session.partial_data = data:match("[^\n]+$"); |
155 end | |
156 | |
157 function console_listener.onreadtimeout(conn) | |
158 local session = sessions[conn]; | |
159 if session then | |
160 session.send("\0"); | |
161 return true; | |
162 end | |
155 end | 163 end |
156 | 164 |
157 function console_listener.ondisconnect(conn, err) | 165 function console_listener.ondisconnect(conn, err) |
158 local session = sessions[conn]; | 166 local session = sessions[conn]; |
159 if session then | 167 if session then |