aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_c2s.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2013-05-30 14:32:40 +0200
committerKim Alvefur <zash@zash.se>2013-05-30 14:32:40 +0200
commit8d85647c37f3b1fd49e0d639d5646745672391bd (patch)
treedc6a45f79ff62be44b304e112ee80f9f9d017997 /plugins/mod_c2s.lua
parenteeb633659f244fdcd3a6b1e132e8969e3266603a (diff)
downloadprosody-8d85647c37f3b1fd49e0d639d5646745672391bd.tar.gz
prosody-8d85647c37f3b1fd49e0d639d5646745672391bd.zip
mod_c2s, mod_c2s: Send a whitespace on read timeout, to prod TCP into detecting if the connection died
Diffstat (limited to 'plugins/mod_c2s.lua')
-rw-r--r--plugins/mod_c2s.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/plugins/mod_c2s.lua b/plugins/mod_c2s.lua
index 1d2dd6dd..f9a270c7 100644
--- a/plugins/mod_c2s.lua
+++ b/plugins/mod_c2s.lua
@@ -262,6 +262,13 @@ function listener.ondisconnect(conn, err)
end
end
+function listener.onreadtimeout(conn)
+ local session = sessions[conn];
+ if session then
+ return session.send(' ');
+ end
+end
+
function listener.associate_session(conn, session)
sessions[conn] = session;
end