dovecot-2.2: imapc: If login is aborted at deinit, don't log an ...

dovecot at dovecot.org dovecot at dovecot.org
Tue Jun 23 09:15:25 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/f06008be0d1d
changeset: 18884:f06008be0d1d
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Jun 23 11:12:38 2015 +0200
description:
imapc: If login is aborted at deinit, don't log an error.

diffstat:

 src/lib-storage/index/imapc/imapc-list.c    |  2 ++
 src/lib-storage/index/imapc/imapc-storage.c |  8 ++++++++
 src/lib-storage/index/imapc/imapc-storage.h |  1 +
 3 files changed, 11 insertions(+), 0 deletions(-)

diffs (48 lines):

diff -r 771254b34a42 -r f06008be0d1d src/lib-storage/index/imapc/imapc-list.c
--- a/src/lib-storage/index/imapc/imapc-list.c	Tue Jun 23 11:02:20 2015 +0200
+++ b/src/lib-storage/index/imapc/imapc-list.c	Tue Jun 23 11:12:38 2015 +0200
@@ -87,6 +87,8 @@
 {
 	struct imapc_mailbox_list *list = (struct imapc_mailbox_list *)_list;
 
+	list->client->destroying = TRUE;
+
 	/* make sure all pending commands are aborted before anything is
 	   deinitialized */
 	if (list->client != NULL) {
diff -r 771254b34a42 -r f06008be0d1d src/lib-storage/index/imapc/imapc-storage.c
--- a/src/lib-storage/index/imapc/imapc-storage.c	Tue Jun 23 11:02:20 2015 +0200
+++ b/src/lib-storage/index/imapc/imapc-storage.c	Tue Jun 23 11:12:38 2015 +0200
@@ -207,6 +207,12 @@
 
 	if (reply->state == IMAPC_COMMAND_STATE_OK)
 		return;
+	if (client->destroying &&
+	    reply->state == IMAPC_COMMAND_STATE_DISCONNECTED) {
+		/* user's work was finished before imapc login finished -
+		   it's not an error */
+		return;
+	}
 
 	i_error("imapc: Authentication failed: %s", reply->text_full);
 	client->auth_failed = TRUE;
@@ -350,6 +356,8 @@
 {
 	struct imapc_storage *storage = (struct imapc_storage *)_storage;
 
+	storage->client->destroying = TRUE;
+
 	/* make sure all pending commands are aborted before anything is
 	   deinitialized */
 	imapc_client_disconnect(storage->client->client);
diff -r 771254b34a42 -r f06008be0d1d src/lib-storage/index/imapc/imapc-storage.h
--- a/src/lib-storage/index/imapc/imapc-storage.h	Tue Jun 23 11:02:20 2015 +0200
+++ b/src/lib-storage/index/imapc/imapc-storage.h	Tue Jun 23 11:12:38 2015 +0200
@@ -52,6 +52,7 @@
 	ARRAY(struct imapc_storage_event_callback) untagged_callbacks;
 
 	unsigned int auth_failed:1;
+	unsigned int destroying:1;
 };
 
 struct imapc_storage {


More information about the dovecot-cvs mailing list