util.adminstream: Set a read timeout handler

So that net.server doesn't close the connection on inactivity.
This commit is contained in:
Kim Alvefur 2020-06-04 16:17:14 +02:00
parent 4bab7af07d
commit a6c4ce73ef

View file

@ -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;