]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
login-common: Add shutting_down and resource_constraint fields to client struct
authorMarkus Valentin <markus.valentin@open-xchange.com>
Thu, 9 Mar 2023 09:57:14 +0000 (10:57 +0100)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Thu, 23 Mar 2023 08:06:31 +0000 (08:06 +0000)
src/login-common/client-common.c
src/login-common/client-common.h

index 03a5ad207a818b8fba429510b4ff301cbf1cc35d..028929bd51bf3ee5e638cd6912cc2dede5b20823 100644 (file)
@@ -1272,6 +1272,13 @@ void client_notify_disconnect(struct client *client,
        if (!client->notified_disconnect) {
                if (client->v.notify_disconnect != NULL)
                        client->v.notify_disconnect(client, reason, text);
+               if (reason == CLIENT_DISCONNECT_SYSTEM_SHUTDOWN) {
+                       client->shutting_down = TRUE;
+               }
+               if (reason == CLIENT_DISCONNECT_RESOURCE_CONSTRAINT) {
+                       client->shutting_down = TRUE;
+                       client->resource_constraint = TRUE;
+               }
                client->notified_disconnect = TRUE;
        }
 }
index 48db31cc5dc2f70c74b59d77fbeb9c67bf68dca1..39fdd3ee248fe608908d0f76bcd11ac3f842ef89 100644 (file)
@@ -285,6 +285,8 @@ struct client {
        bool notified_auth_ready:1;
        bool notified_disconnect:1;
        bool fd_proxying:1;
+       bool shutting_down:1;
+       bool resource_constraint:1;
        /* ... */
 };