aboutsummaryrefslogtreecommitdiffstats
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
commit88833e9c01a27fa19f01ed73009e7c82575f3b11 (patch)
treeb614b29e64f4f1626e4009aa5fb47eabdce242d6
parent05bfe971bf9839b1b2319b60dac65ef299ef07ef (diff)
downloadprosody-88833e9c01a27fa19f01ed73009e7c82575f3b11.tar.gz
prosody-88833e9c01a27fa19f01ed73009e7c82575f3b11.zip
util.adminstream: Set a read timeout handler
So that net.server doesn't close the connection on inactivity.
-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;