From 10470cea67eeb2ff34acbb37aac292bc6468ba07 Mon Sep 17 00:00:00 2001 From: nicm Date: Mon, 5 Apr 2021 14:11:05 +0000 Subject: [PATCH] Move client-detached into server_client_lost so it is fired even if a client is closed unexpectedly. --- server-client.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server-client.c b/server-client.c index adeea5dd..219fdf3a 100644 --- a/server-client.c +++ b/server-client.c @@ -299,6 +299,9 @@ server_client_lost(struct client *c) TAILQ_REMOVE(&clients, c, entry); log_debug("lost client %p", c); + if (c->flags & CLIENT_ATTACHED) + notify_client("client-detached", c); + if (c->flags & CLIENT_CONTROL) control_stop(c); if (c->flags & CLIENT_TERMINAL) @@ -1769,9 +1772,6 @@ server_client_check_exit(struct client *c) if (EVBUFFER_LENGTH(cf->buffer) != 0) return; } - - if (c->flags & CLIENT_ATTACHED) - notify_client("client-detached", c); c->flags |= CLIENT_EXITED; switch (c->exit_type) {