]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap, pop3: shutdown_clients setting wasn't working.
authorTimo Sirainen <tss@iki.fi>
Fri, 4 Sep 2009 21:33:00 +0000 (17:33 -0400)
committerTimo Sirainen <tss@iki.fi>
Fri, 4 Sep 2009 21:33:00 +0000 (17:33 -0400)
--HG--
branch : HEAD

src/imap/main.c
src/pop3/main.c

index 627087fad3fc0bda378c5ee382e5bad532e668c5..14ad317c7794807e47274b5577fcf13d8effb839 100644 (file)
@@ -36,18 +36,8 @@ static struct client_workaround_list client_workaround_list[] = {
        { NULL, 0 }
 };
 
-static struct io *log_io = NULL;
-
 void (*hook_client_created)(struct client **client) = NULL;
 
-static void log_error_callback(void *context ATTR_UNUSED)
-{
-       /* the log fd is closed, don't die when trying to log later */
-       i_set_failure_ignore_errors(TRUE);
-
-       master_service_stop(master_service);
-}
-
 static enum client_workarounds
 parse_workarounds(const struct imap_settings *set)
 {
@@ -128,11 +118,8 @@ static void main_init(const struct imap_settings *set, struct mail_user *user,
        struct client *client;
        struct ostream *output;
 
-       if (set->shutdown_clients && !dump_capability) {
-               /* If master dies, the log fd gets closed and we'll quit */
-               log_io = io_add(STDERR_FILENO, IO_ERROR,
-                               log_error_callback, NULL);
-       }
+       if (set->shutdown_clients && !dump_capability)
+               master_service_set_die_with_master(master_service, TRUE);
 
        client = client_create(0, 1, user, set);
         client->workarounds = parse_workarounds(set);
@@ -152,8 +139,6 @@ static void main_init(const struct imap_settings *set, struct mail_user *user,
 
 static void main_deinit(void)
 {
-       if (log_io != NULL)
-               io_remove(&log_io);
        clients_destroy_all();
 }
 
index ebb614651a146808ca6b11c6c3989fca4cae25f7..a059225937745db75836d2e6ade6ad0a54ddc814 100644 (file)
 
 void (*hook_client_created)(struct client **client) = NULL;
 
-static struct io *log_io = NULL;
-
-static void log_error_callback(void *context ATTR_UNUSED)
-{
-       /* the log fd is closed, don't die when trying to log later */
-       i_set_failure_ignore_errors(TRUE);
-
-       master_service_stop(master_service);
-}
-
 static bool main_init(const struct pop3_settings *set, struct mail_user *user)
 {
        struct client *client;
        const char *str;
        bool ret = TRUE;
 
-       if (set->shutdown_clients) {
-               /* If master dies, the log fd gets closed and we'll quit */
-               log_io = io_add(STDERR_FILENO, IO_ERROR,
-                               log_error_callback, NULL);
-       }
+       if (set->shutdown_clients)
+               master_service_set_die_with_master(master_service, TRUE);
 
        client = client_create(0, 1, user, set);
        if (client == NULL)
@@ -65,8 +52,6 @@ static bool main_init(const struct pop3_settings *set, struct mail_user *user)
 
 static void main_deinit(void)
 {
-       if (log_io != NULL)
-               io_remove(&log_io);
        clients_destroy_all();
 }