dovecot-1.1: maildir: Write dovecot-uidlist before syncing index...

dovecot at dovecot.org dovecot at dovecot.org
Fri Jun 6 17:15:19 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/5f481022db04
changeset: 7611:5f481022db04
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Jun 06 17:15:14 2008 +0300
description:
maildir: Write dovecot-uidlist before syncing index to make sure that any
new messages' filenames are available immediately when they're seen in index.

diffstat:

1 file changed, 7 insertions(+), 10 deletions(-)
src/lib-storage/index/maildir/maildir-uidlist.c |   17 +++++++----------

diffs (36 lines):

diff -r 280e570a5ced -r 5f481022db04 src/lib-storage/index/maildir/maildir-uidlist.c
--- a/src/lib-storage/index/maildir/maildir-uidlist.c	Wed Jun 04 20:32:33 2008 +0300
+++ b/src/lib-storage/index/maildir/maildir-uidlist.c	Fri Jun 06 17:15:14 2008 +0300
@@ -1550,6 +1550,13 @@ void maildir_uidlist_sync_finish(struct 
 
 	ctx->finished = TRUE;
 	ctx->uidlist->initial_sync = TRUE;
+
+	i_assert(ctx->locked || !ctx->changed);
+	if ((ctx->changed || ctx->uidlist->recreate) &&
+	    !ctx->failed && ctx->locked) T_BEGIN {
+		if (maildir_uidlist_sync_update(ctx) < 0)
+			ctx->failed = TRUE;
+	} T_END;
 }
 
 int maildir_uidlist_sync_deinit(struct maildir_uidlist_sync_ctx **_ctx)
@@ -1561,18 +1568,8 @@ int maildir_uidlist_sync_deinit(struct m
 
 	if (!ctx->finished)
 		maildir_uidlist_sync_finish(ctx);
-
 	if (ctx->partial)
 		maildir_uidlist_mark_all(ctx->uidlist, FALSE);
-
-	i_assert(ctx->locked || !ctx->changed);
-	if ((ctx->changed || ctx->uidlist->recreate) &&
-	    !ctx->failed && ctx->locked) {
-		T_BEGIN {
-			ret = maildir_uidlist_sync_update(ctx);
-		} T_END;
-	}
-
 	if (ctx->locked)
 		maildir_uidlist_unlock(ctx->uidlist);
 


More information about the dovecot-cvs mailing list