[dovecot-cvs] dovecot/src/lib-index mail-index-view-sync.c, 1.52.2.11, 1.52.2.12

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


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

Modified Files:
      Tag: branch_1_0
	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.52.2.11
retrieving revision 1.52.2.12
diff -u -d -r1.52.2.11 -r1.52.2.12
--- mail-index-view-sync.c	11 Mar 2007 19:09:59 -0000	1.52.2.11
+++ mail-index-view-sync.c	14 Mar 2007 13:49:18 -0000	1.52.2.12
@@ -460,7 +460,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);
 
@@ -655,10 +655,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