dovecot-2.2: imap: Commit temporary mail's transaction before fi...

dovecot at dovecot.org dovecot at dovecot.org
Mon Oct 29 14:18:13 EET 2012


details:   http://hg.dovecot.org/dovecot-2.2/rev/4e8d7cfec5dc
changeset: 15268:4e8d7cfec5dc
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Oct 29 14:16:02 2012 +0200
description:
imap: Commit temporary mail's transaction before finishing sync.
Fixes assert-crash with mailbox list indexes.

diffstat:

 src/imap/imap-sync.c |  10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diffs (32 lines):

diff -r b5a5f5139148 -r 4e8d7cfec5dc src/imap/imap-sync.c
--- a/src/imap/imap-sync.c	Mon Oct 29 14:17:40 2012 +0200
+++ b/src/imap/imap-sync.c	Mon Oct 29 14:16:02 2012 +0200
@@ -306,12 +306,15 @@
 	ctx->finished = TRUE;
 
 	mail_free(&ctx->mail);
+	/* the transaction is used only for fetching modseqs/flags.
+	   it can't really fail.. */
+	(void)mailbox_transaction_commit(&ctx->t);
+
 	if (array_is_created(&ctx->expunges))
 		array_free(&ctx->expunges);
 
 	if (mailbox_sync_deinit(&ctx->sync_ctx, &ctx->sync_status) < 0 ||
 	    ctx->failed) {
-		mailbox_transaction_rollback(&ctx->t);
 		ctx->failed = TRUE;
 		return -1;
 	}
@@ -319,11 +322,6 @@
 				STATUS_MESSAGES | STATUS_RECENT |
 				STATUS_HIGHESTMODSEQ, &ctx->status);
 
-	if (mailbox_transaction_commit(&ctx->t) < 0) {
-		ctx->failed = TRUE;
-		ret = -1;
-	}
-
 	if (ctx->status.uidvalidity != client->uidvalidity) {
 		/* most clients would get confused by this. disconnect them. */
 		client_disconnect_with_error(client,


More information about the dovecot-cvs mailing list