changeset 5755:a380a5dc9307 HEAD

Don't update log_file_tail_offset in header until syncing is finished.
author Timo Sirainen <tss@iki.fi>
date Sat, 16 Jun 2007 01:10:44 +0300
parents 0096aaf83731
children 69a95671da35
files src/lib-index/mail-index-sync-update.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-index-sync-update.c	Sat Jun 16 01:09:26 2007 +0300
+++ b/src/lib-index/mail-index-sync-update.c	Sat Jun 16 01:10:44 2007 +0300
@@ -435,6 +435,7 @@
 			      struct mail_index_sync_map_ctx *ctx)
 {
 	struct mail_index_map *map = ctx->view->map;
+	uint32_t orig_log_file_tail_offset = map->hdr.log_file_tail_offset;
 
 	if (u->offset >= map->hdr.base_header_size ||
 	    u->offset + u->size > map->hdr.base_header_size) {
@@ -456,6 +457,11 @@
 		memcpy(PTR_OFFSET(&map->hdr, u->offset),
 		       u + 1, sizeof(map->hdr) - u->offset);
 	}
+
+	/* the tail offset updates are intended for internal transaction
+	   log handling. we'll update the offset in the header only when
+	   the sync is finished. */
+	map->hdr.log_file_tail_offset = orig_log_file_tail_offset;
 	return 1;
 }