dovecot-1.1: Fixed "uid_validity updated unexpectedly" errors wh...

dovecot at dovecot.org dovecot at dovecot.org
Thu Feb 21 14:44:37 EET 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/1d87dc550378
changeset: 7273:1d87dc550378
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Feb 21 14:46:01 2008 +0200
description:
Fixed "uid_validity updated unexpectedly" errors when mbox file was being
recreated and index files still existed.

diffstat:

1 file changed, 6 insertions(+), 9 deletions(-)
src/lib-storage/index/mbox/mbox-sync.c |   15 ++++++---------

diffs (25 lines):

diff -r 1e5deb36a79f -r 1d87dc550378 src/lib-storage/index/mbox/mbox-sync.c
--- a/src/lib-storage/index/mbox/mbox-sync.c	Thu Feb 21 13:43:17 2008 +0200
+++ b/src/lib-storage/index/mbox/mbox-sync.c	Thu Feb 21 14:46:01 2008 +0200
@@ -1324,15 +1324,12 @@ static int mbox_sync_update_index_header
 	   is entirely empty. In that case just make up a new one if needed. */
 	i_assert(sync_ctx->base_uid_validity != 0 || st->st_size == 0);
 
-	if (sync_ctx->base_uid_validity != sync_ctx->hdr->uid_validity ||
-	    sync_ctx->base_uid_validity == 0) {
-		if (sync_ctx->base_uid_validity == 0) {
-                        sync_ctx->base_uid_validity =
-				sync_ctx->hdr->uid_validity != 0 ?
-				sync_ctx->hdr->uid_validity :
-				(unsigned int)ioloop_time;
-		}
-
+	if (sync_ctx->base_uid_validity == 0) {
+		sync_ctx->base_uid_validity = sync_ctx->hdr->uid_validity != 0 ?
+			sync_ctx->hdr->uid_validity :
+			I_MIN((unsigned int)ioloop_time, 1);
+	}
+	if (sync_ctx->base_uid_validity != sync_ctx->hdr->uid_validity) {
 		mail_index_update_header(sync_ctx->t,
 			offsetof(struct mail_index_header, uid_validity),
 			&sync_ctx->base_uid_validity,


More information about the dovecot-cvs mailing list