dovecot: Always commit FETCH transaction to make sure cached dat...

dovecot at dovecot.org dovecot at dovecot.org
Sun Jun 17 22:01:22 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/7851879631ea
changeset: 5760:7851879631ea
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Jun 17 22:01:16 2007 +0300
description:
Always commit FETCH transaction to make sure cached data is committed.

diffstat:

1 file changed, 5 insertions(+), 6 deletions(-)
src/imap/imap-fetch.c |   11 +++++------

diffs (21 lines):

diff -r 6074f59f91ba -r 7851879631ea src/imap/imap-fetch.c
--- a/src/imap/imap-fetch.c	Sun Jun 17 18:13:19 2007 +0300
+++ b/src/imap/imap-fetch.c	Sun Jun 17 22:01:16 2007 +0300
@@ -384,12 +384,11 @@ int imap_fetch_deinit(struct imap_fetch_
 		mailbox_header_lookup_deinit(&ctx->all_headers_ctx);
 
 	if (ctx->trans != NULL) {
-		if (ctx->failed)
-			mailbox_transaction_rollback(&ctx->trans);
-		else {
-			if (mailbox_transaction_commit(&ctx->trans, 0) < 0)
-				ctx->failed = TRUE;
-		}
+		/* even if something failed, we want to commit changes to
+		   cache, as well as possible \Seen flag changes for FETCH
+		   replies we returned so far. */
+		if (mailbox_transaction_commit(&ctx->trans, 0) < 0)
+			ctx->failed = TRUE;
 	}
 	return ctx->failed ? -1 : 0;
 }


More information about the dovecot-cvs mailing list