dovecot-2.2: imap, pop3: Show user's proper log prefix when dein...

dovecot at dovecot.org dovecot at dovecot.org
Thu Sep 25 12:50:29 UTC 2014


details:   http://hg.dovecot.org/dovecot-2.2/rev/576da94fd669
changeset: 17841:576da94fd669
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Sep 25 15:37:48 2014 +0300
description:
imap, pop3: Show user's proper log prefix when deinitializing users at exit.

diffstat:

 src/imap/imap-client.c |  4 +++-
 src/imap/imap-client.h |  3 ++-
 src/imap/main.c        |  4 +++-
 src/pop3/main.c        |  2 +-
 src/pop3/pop3-client.c |  4 +++-
 src/pop3/pop3-client.h |  3 ++-
 6 files changed, 14 insertions(+), 6 deletions(-)

diffs (119 lines):

diff -r a3352c6c483e -r 576da94fd669 src/imap/imap-client.c
--- a/src/imap/imap-client.c	Thu Sep 25 15:37:01 2014 +0300
+++ b/src/imap/imap-client.c	Thu Sep 25 15:37:48 2014 +0300
@@ -1111,12 +1111,14 @@
 	array_clear(&client->search_updates);
 }
 
-void clients_destroy_all(void)
+void clients_destroy_all(struct mail_storage_service_ctx *storage_service)
 {
 	while (imap_clients != NULL) {
 		client_send_line(imap_clients, "* BYE Server shutting down.");
+		mail_storage_service_io_activate_user(imap_clients->service_user);
 		client_destroy(imap_clients, "Server shutting down.");
 	}
+	mail_storage_service_io_deactivate(storage_service);
 }
 
 struct imap_client_vfuncs imap_client_vfuncs = {
diff -r a3352c6c483e -r 576da94fd669 src/imap/imap-client.h
--- a/src/imap/imap-client.h	Thu Sep 25 15:37:01 2014 +0300
+++ b/src/imap/imap-client.h	Thu Sep 25 15:37:48 2014 +0300
@@ -12,6 +12,7 @@
 
 struct client;
 struct mail_storage;
+struct mail_storage_service_ctx;
 struct imap_parser;
 struct imap_arg;
 struct imap_urlauth_context;
@@ -244,6 +245,6 @@
 bool client_handle_input(struct client *client);
 int client_output(struct client *client);
 
-void clients_destroy_all(void);
+void clients_destroy_all(struct mail_storage_service_ctx *storage_service);
 
 #endif
diff -r a3352c6c483e -r 576da94fd669 src/imap/main.c
--- a/src/imap/main.c	Thu Sep 25 15:37:01 2014 +0300
+++ b/src/imap/main.c	Thu Sep 25 15:37:48 2014 +0300
@@ -114,6 +114,7 @@
 	for (client = imap_clients; client != NULL; client = next) {
 		next = client->next;
 
+		mail_storage_service_io_activate_user(client->service_user);
 		last_io = I_MAX(client->last_input, client->last_output);
 		if (last_io <= stop_timestamp)
 			client_kill_idle(client);
@@ -124,6 +125,7 @@
 						      client_kill_idle, client);
 		}
 	}
+	mail_storage_service_io_deactivate(storage_service);
 }
 
 struct client_input {
@@ -408,7 +410,7 @@
 
 	if (io_loop_is_running(current_ioloop))
 		master_service_run(master_service, client_connected);
-	clients_destroy_all();
+	clients_destroy_all(storage_service);
 
 	if (master_login != NULL)
 		master_login_deinit(&master_login);
diff -r a3352c6c483e -r 576da94fd669 src/pop3/main.c
--- a/src/pop3/main.c	Thu Sep 25 15:37:01 2014 +0300
+++ b/src/pop3/main.c	Thu Sep 25 15:37:48 2014 +0300
@@ -275,7 +275,7 @@
 
 	if (io_loop_is_running(current_ioloop))
 		master_service_run(master_service, client_connected);
-	clients_destroy_all();
+	clients_destroy_all(storage_service);
 
 	if (master_login != NULL)
 		master_login_deinit(&master_login);
diff -r a3352c6c483e -r 576da94fd669 src/pop3/pop3-client.c
--- a/src/pop3/pop3-client.c	Thu Sep 25 15:37:01 2014 +0300
+++ b/src/pop3/pop3-client.c	Thu Sep 25 15:37:48 2014 +0300
@@ -837,15 +837,17 @@
 	}
 }
 
-void clients_destroy_all(void)
+void clients_destroy_all(struct mail_storage_service_ctx *storage_service)
 {
 	while (pop3_clients != NULL) {
 		if (pop3_clients->cmd == NULL) {
 			client_send_line(pop3_clients,
 				"-ERR [SYS/TEMP] Server shutting down.");
 		}
+		mail_storage_service_io_activate_user(pop3_clients->service_user);
 		client_destroy(pop3_clients, "Server shutting down.");
 	}
+	mail_storage_service_io_deactivate(storage_service);
 }
 
 struct pop3_client_vfuncs pop3_client_vfuncs = {
diff -r a3352c6c483e -r 576da94fd669 src/pop3/pop3-client.h
--- a/src/pop3/pop3-client.h	Thu Sep 25 15:37:01 2014 +0300
+++ b/src/pop3/pop3-client.h	Thu Sep 25 15:37:48 2014 +0300
@@ -5,6 +5,7 @@
 
 struct client;
 struct mail_storage;
+struct mail_storage_service_ctx;
 
 typedef void command_func_t(struct client *client);
 
@@ -133,6 +134,6 @@
 bool client_handle_input(struct client *client);
 bool client_update_mails(struct client *client);
 
-void clients_destroy_all(void);
+void clients_destroy_all(struct mail_storage_service_ctx *storage_service);
 
 #endif


More information about the dovecot-cvs mailing list