dovecot: Handle cache sync updates without breaking, although in...

dovecot at dovecot.org dovecot at dovecot.org
Fri Jun 15 20:53:24 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/702aa70c9f34
changeset: 5745:702aa70c9f34
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Jun 15 19:26:01 2007 +0300
description:
Handle cache sync updates without breaking, although in a bit non-optimal
way for now.

diffstat:

1 file changed, 5 insertions(+), 8 deletions(-)
src/lib-index/mail-cache-sync-update.c |   13 +++++--------

diffs (31 lines):

diff -r bf9f97c09250 -r 702aa70c9f34 src/lib-index/mail-cache-sync-update.c
--- a/src/lib-index/mail-cache-sync-update.c	Fri Jun 15 19:25:20 2007 +0300
+++ b/src/lib-index/mail-cache-sync-update.c	Fri Jun 15 19:26:01 2007 +0300
@@ -122,9 +122,12 @@ int mail_cache_sync_handler(struct mail_
 				      (uoff_t)-1);
 	}
 
-	if (*old_cache_offset == 0 ||
-	    sync_ctx->type != MAIL_INDEX_SYNC_HANDLER_FILE)
+	if (*old_cache_offset == 0 || *old_cache_offset == *new_cache_offset ||
+	    sync_ctx->type == MAIL_INDEX_SYNC_HANDLER_VIEW)
 		return 1;
+
+	/* FIXME: we should do this only once to avoid extra overhead.
+	   currently this can happen multiple times as map is synchronized. */
 
 	/* we'll need to link the old and new cache records */
 	ret = mail_cache_handler_init(&ctx, cache);
@@ -140,12 +143,6 @@ int mail_cache_sync_handler(struct mail_
 		return 1;
 	}
 
-	if (*old_cache_offset == *new_cache_offset) {
-		mail_index_sync_set_corrupted(sync_ctx,
-			"Cache offset replaced with itself");
-		return -1;
-	}
-
 	if (mail_cache_link(cache, *old_cache_offset, *new_cache_offset) < 0)
 		return -1;
 


More information about the dovecot-cvs mailing list