dovecot-1.0: Always commit FETCH transaction to make sure cached...

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


details:   http://hg.dovecot.org/dovecot-1.0/rev/e1cd11c5e00a
changeset: 5319:e1cd11c5e00a
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Jun 17 22:01:15 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 f88b1e225be5 -r e1cd11c5e00a src/imap/imap-fetch.c
--- a/src/imap/imap-fetch.c	Sun Jun 17 18:13:18 2007 +0300
+++ b/src/imap/imap-fetch.c	Sun Jun 17 22:01:15 2007 +0300
@@ -363,12 +363,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