changeset 7145:5187649faa52 HEAD

Make sure tail offset gets updated when extension records are updated.
author Timo Sirainen <tss@iki.fi>
date Fri, 11 Jan 2008 05:27:46 +0200
parents 0734af67ca99
children ca223be145b5
files src/lib-index/mail-index-sync.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-index-sync.c	Fri Jan 11 04:42:37 2008 +0200
+++ b/src/lib-index/mail-index-sync.c	Fri Jan 11 05:27:46 2008 +0200
@@ -503,6 +503,10 @@
 			continue;
 
 		switch (hdr->type & MAIL_TRANSACTION_TYPE_MASK) {
+		case MAIL_TRANSACTION_EXT_REC_UPDATE:
+			/* extension record updates aren't exactly needed
+			   to be synced, but cache syncing relies on tail
+			   offsets being updated. */
 		case MAIL_TRANSACTION_EXPUNGE:
 		case MAIL_TRANSACTION_FLAG_UPDATE:
 		case MAIL_TRANSACTION_KEYWORD_UPDATE:
@@ -684,7 +688,6 @@
 static void
 mail_index_sync_update_mailbox_offset(struct mail_index_sync_ctx *ctx)
 {
-	const struct mail_index_header *hdr = &ctx->index->map->hdr;
 	uint32_t seq;
 	uoff_t offset;
 
@@ -694,7 +697,7 @@
 
 	/* If tail offset has changed, make sure it gets written to
 	   transaction log. */
-	if (hdr->log_file_tail_offset != ctx->last_tail_offset)
+	if (ctx->last_tail_offset != offset)
 		ctx->ext_trans->log_updates = TRUE;
 }