From 88833e9c01a27fa19f01ed73009e7c82575f3b11 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Thu, 4 Jun 2020 16:17:14 +0200 Subject: util.adminstream: Set a read timeout handler So that net.server doesn't close the connection on inactivity. --- util/adminstream.lua | 9 +++++++++ 1 file changed, 9 insertions(+) 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; -- cgit v1.2.3