[dovecot-cvs] dovecot/src/lib-index mail-index-view-sync.c, 1.52.2.8, 1.52.2.9

tss at dovecot.org tss at dovecot.org
Sat Mar 10 20:46:56 EET 2007


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

Modified Files:
      Tag: branch_1_0
	mail-index-view-sync.c 
Log Message:
cleanups



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.8
retrieving revision 1.52.2.9
diff -u -d -r1.52.2.8 -r1.52.2.9
--- mail-index-view-sync.c	10 Mar 2007 17:03:12 -0000	1.52.2.8
+++ mail-index-view-sync.c	10 Mar 2007 18:46:54 -0000	1.52.2.9
@@ -99,6 +99,7 @@
 	const struct mail_index_header *hdr = view->index->hdr;
 	int ret;
 
+	/* the view begins from the first non-synced transaction */
 	ret = mail_transaction_log_view_set(view->log_view,
 					    view->log_file_seq,
 					    view->log_file_offset,
@@ -131,6 +132,9 @@
 	if (view_sync_set_log_view_range(view, MAIL_TRANSACTION_EXPUNGE) < 0)
 		return -1;
 
+	/* get a list of expunge transactions. there may be some that we have
+	   already synced, but it doesn't matter because they'll get dropped
+	   out when converting to sequences */
 	ARRAY_CREATE(expunges_r, default_pool,
 		     struct mail_transaction_expunge, 64);
 	while ((ret = mail_transaction_log_view_next(view->log_view,
@@ -311,8 +315,6 @@
 		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;
@@ -322,14 +324,14 @@
 			   update flag counters. note that map->hdr may contain
 			   old information if another process updated the
 			   index file since. */
-			if (view->map->mmap_base == NULL)
-				hdr = &view->map->hdr;
-			else {
+			if (view->map->mmap_base != NULL) {
+				const struct mail_index_header *hdr;
+
 				hdr = view->map->mmap_base;
 				view->map->hdr = *hdr;
 			}
 			ctx->sync_map_ctx.unreliable_flags =
-				!VIEW_IS_SYNCED_TO_SAME(view, hdr);
+				!VIEW_IS_SYNCED_TO_SAME(view, &view->map->hdr);
 
 			/* Copy only the mails that we see currently, since
 			   we're going to append the new ones when we see



More information about the dovecot-cvs mailing list