[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-sync-private.h, 1.30, 1.31 mbox-sync.c, 1.83, 1.84

cras at dovecot.org cras at dovecot.org
Sat Sep 11 21:30:52 EEST 2004


Update of /var/lib/cvs/dovecot/src/lib-storage/index/mbox
In directory talvi:/tmp/cvs-serv31549/lib-storage/index/mbox

Modified Files:
	mbox-sync-private.h mbox-sync.c 
Log Message:
Last from offset sync fix broke everything. Another try.



Index: mbox-sync-private.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-sync-private.h,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- mbox-sync-private.h	10 Sep 2004 10:49:09 -0000	1.30
+++ mbox-sync-private.h	11 Sep 2004 18:30:50 -0000	1.31
@@ -37,6 +37,7 @@
 
 struct mbox_sync_mail {
 	uint32_t uid;
+	uint32_t idx_seq;
 	uint8_t flags;
 	keywords_mask_t keywords;
 

Index: mbox-sync.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-sync.c,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -d -r1.83 -r1.84
--- mbox-sync.c	11 Sep 2004 17:28:04 -0000	1.83
+++ mbox-sync.c	11 Sep 2004 18:30:50 -0000	1.84
@@ -470,7 +470,7 @@
 static int update_from_offsets(struct mbox_sync_context *sync_ctx)
 {
 	const struct mbox_sync_mail *mails;
-	uint32_t idx, idx_seq, uid, extra_idx;
+	uint32_t idx, extra_idx;
 	uint64_t offset;
 	size_t size;
 
@@ -480,37 +480,13 @@
 	size /= sizeof(*mails);
 	i_assert(sync_ctx->seq - sync_ctx->need_space_seq + 1 == size);
 
-	idx_seq = 0;
 	for (idx = 0; idx < size; idx++) {
-		if (mails[idx].uid == 0)
+		if (mails[idx].idx_seq == 0)
 			continue;
 
-		if (idx_seq != 0) {
-			/* it's probably the next one */
-			idx_seq++;
-			if (mail_index_lookup_uid(sync_ctx->sync_view, idx_seq,
-						  &uid) < 0) {
-				mail_storage_set_index_error(sync_ctx->ibox);
-				return -1;
-			}
-			if (uid != mails[idx].uid)
-				idx_seq = 0;
-		}
-
-		if (idx_seq == 0) {
-			if (mail_index_lookup_uid_range(sync_ctx->sync_view,
-							mails[idx].uid,
-							mails[idx].uid,
-							&idx_seq,
-							&idx_seq) < 0) {
-				mail_storage_set_index_error(sync_ctx->ibox);
-				return -1;
-			}
-		}
-
 		offset = mails[idx].from_offset;
-		mail_index_update_extra_rec(sync_ctx->t, idx_seq, extra_idx,
-					    &offset);
+		mail_index_update_extra_rec(sync_ctx->t, mails[idx].idx_seq,
+					    extra_idx, &offset);
 	}
 	return 0;
 }
@@ -795,6 +771,8 @@
 			sync_ctx->prev_msg_uid = mail_ctx->mail.uid;
 		}
 
+		mail_ctx->mail.idx_seq = sync_ctx->idx_seq;
+
 		if (!expunged) {
 			ret = mbox_sync_handle_header(mail_ctx);
 			sync_ctx->dest_first_mail = FALSE;



More information about the dovecot-cvs mailing list