[dovecot-cvs] dovecot/src/lib-storage/index/maildir maildir-sync.c, 1.92, 1.93 maildir-uidlist.c, 1.61, 1.62 maildir-uidlist.h, 1.20, 1.21

tss at dovecot.org tss at dovecot.org
Wed Mar 21 21:22:42 EET 2007


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

Modified Files:
	maildir-sync.c maildir-uidlist.c maildir-uidlist.h 
Log Message:
If uidlist is deleted and we set the uidvalidity from the index file, set
also next_uid.



Index: maildir-sync.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/maildir/maildir-sync.c,v
retrieving revision 1.92
retrieving revision 1.93
diff -u -d -r1.92 -r1.93
--- maildir-sync.c	21 Mar 2007 19:19:57 -0000	1.92
+++ maildir-sync.c	21 Mar 2007 19:22:39 -0000	1.93
@@ -1249,7 +1249,7 @@
 		   have to do it here before syncing index records, since after
 		   that the uidlist's next_uid value may have changed. */
 		next_uid = maildir_uidlist_get_next_uid(mbox->uidlist);
-		if (next_uid != 0 && hdr->next_uid != next_uid) {
+		if (hdr->next_uid < next_uid) {
 			mail_index_update_header(trans,
 				offsetof(struct mail_index_header, next_uid),
 				&next_uid, sizeof(next_uid), FALSE);
@@ -1293,11 +1293,12 @@
 		if (uid_validity == 0) {
 			uid_validity = ioloop_time;
 			maildir_uidlist_set_uid_validity(mbox->uidlist,
-							 uid_validity);
+							 uid_validity, 1);
 		}
 	} else if (uid_validity == 0) {
 		maildir_uidlist_set_uid_validity(mbox->uidlist,
-						 hdr->uid_validity);
+						 hdr->uid_validity,
+						 hdr->next_uid);
 	}
 
 	if (uid_validity != hdr->uid_validity && uid_validity != 0) {

Index: maildir-uidlist.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/maildir/maildir-uidlist.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -d -r1.61 -r1.62
--- maildir-uidlist.c	19 Mar 2007 13:59:20 -0000	1.61
+++ maildir-uidlist.c	21 Mar 2007 19:22:39 -0000	1.62
@@ -539,9 +539,10 @@
 }
 
 void maildir_uidlist_set_uid_validity(struct maildir_uidlist *uidlist,
-				      uint32_t uid_validity)
+				      uint32_t uid_validity, uint32_t next_uid)
 {
 	uidlist->uid_validity = uid_validity;
+	uidlist->next_uid = next_uid;
 }
 
 uint32_t maildir_uidlist_get_next_uid(struct maildir_uidlist *uidlist)

Index: maildir-uidlist.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/maildir/maildir-uidlist.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- maildir-uidlist.h	22 Feb 2007 12:50:15 -0000	1.20
+++ maildir-uidlist.h	21 Mar 2007 19:22:39 -0000	1.21
@@ -38,7 +38,7 @@
 uint32_t maildir_uidlist_get_next_uid(struct maildir_uidlist *uidlist);
 
 void maildir_uidlist_set_uid_validity(struct maildir_uidlist *uidlist,
-				      uint32_t uid_validity);
+				      uint32_t uid_validity, uint32_t next_uid);
 
 /* Sync uidlist with what's actually on maildir. Returns same as
    maildir_uidlist_lock(). */



More information about the dovecot-cvs mailing list