[dovecot-cvs] dovecot/src/lib-index mail-index-view-sync.c, 1.52.2.4, 1.52.2.5

tss at dovecot.org tss at dovecot.org
Sun Jan 14 04:01:29 UTC 2007


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

Modified Files:
      Tag: branch_1_0
	mail-index-view-sync.c 
Log Message:
We could have synced external transactions multiple times, causing
corrupted view errors.



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.4
retrieving revision 1.52.2.5
diff -u -d -r1.52.2.4 -r1.52.2.5
--- mail-index-view-sync.c	14 Jan 2007 03:37:13 -0000	1.52.2.4
+++ mail-index-view-sync.c	14 Jan 2007 04:01:27 -0000	1.52.2.5
@@ -200,7 +200,6 @@
                                enum mail_index_sync_type sync_mask,
 			       struct mail_index_view_sync_ctx **ctx_r)
 {
-	const struct mail_index_header *hdr;
 	struct mail_index_view_sync_ctx *ctx;
 	struct mail_index_map *map;
 	enum mail_transaction_type log_get_mask, visible_mask;
@@ -220,7 +219,6 @@
 	if (mail_index_view_lock_head(view, TRUE) < 0)
 		return -1;
 
-	hdr = view->index->hdr;
 	if ((sync_mask & MAIL_INDEX_SYNC_TYPE_EXPUNGE) != 0) {
 		/* get list of all expunges first */
 		if (view_sync_get_expunges(view, &expunges) < 0)
@@ -378,6 +376,13 @@
 		}
 
 		/* skip everything we've already synced */
+		if (offset < view->hdr.log_file_ext_offset &&
+		    seq == view->hdr.log_file_seq &&
+		    (ctx->hdr->type & MAIL_TRANSACTION_EXTERNAL) != 0) {
+			/* view->log_file_offset contains the minimum of
+			   int/ext offsets. */
+			continue;
+		}
 		if (view_sync_pos_find(&view->syncs_done, seq, offset))
 			continue;
 



More information about the dovecot-cvs mailing list