From 6671cc037e8afc4c416556af6e35a26e48fc75e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Sch=C3=A4fer?= Date: Tue, 21 Dec 2021 21:23:01 +0100 Subject: adminstream: fire disconnected event on lower layer disconnect This may in theory cause multiple disconnect events for the adminstream client, if the only code using that wasn't calling os.exit right away. Hence, this should be a good enough partial fix for #1671. It is not a full fix, because the shell will only notice the disconnect after one has hit enter in the input; until then, it is stuck in a read() call to stdin and completely oblivious to the disconnect. --- util/adminstream.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'util/adminstream.lua') diff --git a/util/adminstream.lua b/util/adminstream.lua index 5b592e76..703deb07 100644 --- a/util/adminstream.lua +++ b/util/adminstream.lua @@ -318,6 +318,7 @@ local function new_client() function listeners.ondisconnect(conn, err) --luacheck: ignore 212/conn client.log("info", "Admin client disconnected: %s", err or "connection closed"); client.conn = nil; + client.events.fire_event("disconnected"); end function listeners.onreadtimeout(conn) -- cgit v1.2.3