aboutsummaryrefslogtreecommitdiffstats
path: root/util/adminstream.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2020-06-04 16:17:14 +0200
committerKim Alvefur <zash@zash.se>2020-06-04 16:17:14 +0200
commita6c4ce73ef53b432b88950450bf479938807e0ae (patch)
treeb614b29e64f4f1626e4009aa5fb47eabdce242d6 /util/adminstream.lua
parent4bab7af07d4707eda9246156e20610d95967679c (diff)
downloadprosody-a6c4ce73ef53b432b88950450bf479938807e0ae.tar.gz
prosody-a6c4ce73ef53b432b88950450bf479938807e0ae.zip
util.adminstream: Set a read timeout handler
So that net.server doesn't close the connection on inactivity.
Diffstat (limited to 'util/adminstream.lua')
-rw-r--r--util/adminstream.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/util/adminstream.lua b/util/adminstream.lua
index 70fa2b19..782a6b0f 100644
--- a/util/adminstream.lua
+++ b/util/adminstream.lua
@@ -247,6 +247,11 @@ local function new_server(sessions, stanza_handler)
sessions[conn] = nil;
end
end
+
+ function listeners.onreadtimeout(conn)
+ conn:send(" ");
+ end
+
return {
listeners = listeners;
};
@@ -315,6 +320,10 @@ local function new_client()
client.conn = nil;
end
+ function listeners.onreadtimeout(conn)
+ conn:send(" ");
+ end
+
client.listeners = listeners;
return client;