Changeset

10900:9e6d979dd603

util.adminstream: Set a read timeout handler So that net.server doesn't close the connection on inactivity.
author Kim Alvefur <zash@zash.se>
date Thu, 04 Jun 2020 16:17:14 +0200
parents 10899:8048255ae61e
children 10901:5e33926f4b43
files util/adminstream.lua
diffstat 1 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/util/adminstream.lua	Thu Jun 04 16:11:08 2020 +0200
+++ b/util/adminstream.lua	Thu Jun 04 16:17:14 2020 +0200
@@ -247,6 +247,11 @@
 			sessions[conn]  = nil;
 		end
 	end
+
+	function listeners.onreadtimeout(conn)
+		conn:send(" ");
+	end
+
 	return {
 		listeners = listeners;
 	};
@@ -315,6 +320,10 @@
 		client.conn = nil;
 	end
 
+	function listeners.onreadtimeout(conn)
+		conn:send(" ");
+	end
+
 	client.listeners = listeners;
 
 	return client;