dovecot-2.0: imap, pop3: shutdown_clients setting wasn't working.

dovecot at dovecot.org dovecot at dovecot.org
Sat Sep 5 00:34:25 EEST 2009


details:   http://hg.dovecot.org/dovecot-2.0/rev/e11bd2547bb2
changeset: 9879:e11bd2547bb2
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Sep 04 17:33:00 2009 -0400
description:
imap, pop3: shutdown_clients setting wasn't working.

diffstat:

2 files changed, 4 insertions(+), 34 deletions(-)
src/imap/main.c |   19 ++-----------------
src/pop3/main.c |   19 ++-----------------

diffs (86 lines):

diff -r c58c40a83bbd -r e11bd2547bb2 src/imap/main.c
--- a/src/imap/main.c	Fri Sep 04 17:32:31 2009 -0400
+++ b/src/imap/main.c	Fri Sep 04 17:33:00 2009 -0400
@@ -36,17 +36,7 @@ static struct client_workaround_list cli
 	{ 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_
 	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_
 
 static void main_deinit(void)
 {
-	if (log_io != NULL)
-		io_remove(&log_io);
 	clients_destroy_all();
 }
 
diff -r c58c40a83bbd -r e11bd2547bb2 src/pop3/main.c
--- a/src/pop3/main.c	Fri Sep 04 17:32:31 2009 -0400
+++ b/src/pop3/main.c	Fri Sep 04 17:33:00 2009 -0400
@@ -21,27 +21,14 @@
 
 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_
 
 static void main_deinit(void)
 {
-	if (log_io != NULL)
-		io_remove(&log_io);
 	clients_destroy_all();
 }
 


More information about the dovecot-cvs mailing list