[dovecot-cvs] dovecot/src/lib-index mail-index-view-sync.c, 1.66, 1.67

tss at dovecot.org tss at dovecot.org
Wed Mar 14 15:49:23 EET 2007


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

Modified Files:
	mail-index-view-sync.c 
Log Message:
View syncing fixes



Index: mail-index-view-sync.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index-view-sync.c,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- mail-index-view-sync.c	11 Mar 2007 19:10:02 -0000	1.66
+++ mail-index-view-sync.c	14 Mar 2007 13:49:21 -0000	1.67
@@ -452,7 +452,7 @@
 
 		/* Apply transaction to view's mapping if needed (meaning we
 		   didn't just re-map the view to head mapping). */
-		if (ctx->sync_map_update) {
+		if (ctx->sync_map_update && !synced_to_map) {
 			i_assert((ctx->hdr->type &
 				  MAIL_TRANSACTION_EXPUNGE) == 0);
 
@@ -646,10 +646,22 @@
 	}
 
 	if (ctx->sync_map_update) {
-		view->map->hdr.log_file_seq = view->log_file_seq;
-		view->map->hdr.log_file_int_offset =
+		if (view->log_file_seq != view->map->hdr.log_file_seq) {
+			i_assert(view->log_file_seq >
+				 view->map->hdr.log_file_seq);
+			view->map->hdr.log_file_seq = view->log_file_seq;
 			view->map->hdr.log_file_ext_offset =
-			view->log_file_offset;
+				view->log_file_offset;
+		} else {
+			i_assert(view->log_file_offset >=
+				 view->map->hdr.log_file_int_offset);
+			if (view->log_file_offset >
+			    view->map->hdr.log_file_ext_offset) {
+				view->map->hdr.log_file_ext_offset =
+					view->log_file_offset;
+			}
+		}
+		view->map->hdr.log_file_int_offset = view->log_file_offset;
 	}
 	view->hdr = view->map->hdr;
 



More information about the dovecot-cvs mailing list