[dovecot-cvs] dovecot/src/lib-index mail-index-view-sync.c, 1.60, 1.61

tss at dovecot.org tss at dovecot.org
Wed Jan 17 18:47:48 UTC 2007


Update of /var/lib/cvs/dovecot/src/lib-index
In directory talvi:/tmp/cvs-serv32253

Modified Files:
	mail-index-view-sync.c 
Log Message:
unreliable_flags wasn't always set correctly, which caused "xxx counter
wrong" errors and such.



Index: mail-index-view-sync.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index-view-sync.c,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- mail-index-view-sync.c	14 Jan 2007 04:01:31 -0000	1.60
+++ mail-index-view-sync.c	17 Jan 2007 18:47:46 -0000	1.61
@@ -260,16 +260,22 @@
 		uint32_t old_records_count = view->map->records_count;
 
 		if (view->map != view->index->map) {
+			const struct mail_index_header *hdr;
+
 			/* Using non-head mapping. We have to apply
 			   transactions to it to get latest changes into it. */
 			ctx->sync_map_update = TRUE;
+
 			/* Unless map was synced at the exact same position as
 			   view, the message flags can't be reliably used to
-			   update flag counters. */
+			   update flag counters. note that map->hdr may contain
+			   old information if another process updated the
+			   index file since. */
+			hdr = view->map->mmap_base != NULL ?
+				view->map->mmap_base : &view->map->hdr;
 			ctx->sync_map_ctx.unreliable_flags =
-				!(view->map->hdr.log_file_seq ==
-				  view->log_file_seq &&
-				  view->map->hdr.log_file_int_offset ==
+				!(hdr->log_file_seq == view->log_file_seq &&
+				  hdr->log_file_int_offset ==
 				  view->log_file_offset);
 
 			/* Copy only the mails that we see currently, since



More information about the dovecot-cvs mailing list