# HG changeset patch # User Jonas Schäfer # Date 1640118181 -3600 # Node ID 84fd6a79cda7422bcd063f6b06baacbf4dbd69fa # Parent b446edb2a51ea65c1c2137c6b54718686c34f3b5 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. diff -r b446edb2a51e -r 84fd6a79cda7 util/adminstream.lua --- a/util/adminstream.lua Tue Dec 21 21:38:44 2021 +0100 +++ b/util/adminstream.lua Tue Dec 21 21:23:01 2021 +0100 @@ -318,6 +318,7 @@ 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)