[dovecot-cvs] dovecot/src/lib-storage/index/maildir maildir-sync.c, 1.53, 1.54

cras at dovecot.org cras at dovecot.org
Tue Apr 26 17:45:48 EEST 2005


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

Modified Files:
	maildir-sync.c 
Log Message:
Don't try to handle UIDVALIDITY changes nicely after all. It causes
problems when within same transaction there are two different set of UIDs
being used.



Index: maildir-sync.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/maildir/maildir-sync.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- maildir-sync.c	23 Apr 2005 15:18:22 -0000	1.53
+++ maildir-sync.c	26 Apr 2005 14:45:46 -0000	1.54
@@ -603,7 +603,6 @@
 	struct maildir_uidlist_iter_ctx *iter;
 	struct mail_index_transaction *trans;
 	const struct mail_index_header *hdr;
-	struct mail_index_header tmp_hdr;
 	const struct mail_index_record *rec;
 	pool_t keyword_pool;
 	uint32_t seq, uid;
@@ -627,19 +626,8 @@
 			"Maildir %s sync: UIDVALIDITY changed (%u -> %u)",
 			mbox->path, hdr->uid_validity, uid_validity);
 
-		for (seq = 1; seq < hdr->messages_count; seq++)
-			mail_index_expunge(trans, seq);
-
-		/* Reset uidvalidity and next_uid. */
-		memcpy(&tmp_hdr, hdr, sizeof(tmp_hdr));
-		tmp_hdr.uid_validity = 0;
-		tmp_hdr.next_uid = 0;
-
-		/* next_uid must be reset before message syncing begins,
-		   or we get errors about UIDs larger than next_uid. */
-		mail_index_update_header(trans,
-			offsetof(struct mail_index_header, next_uid),
-			&hdr->next_uid, sizeof(hdr->next_uid), TRUE);
+		mail_index_mark_corrupted(mbox->ibox.index);
+		return -1;
 	}
 
 	keyword_pool = pool_alloconly_create("maildir keywords", 128);



More information about the dovecot-cvs mailing list