[dovecot-cvs] dovecot/src/lib-storage/index/maildir maildir-sync.c, 1.77.2.8, 1.77.2.9 maildir-uidlist.c, 1.51.2.8, 1.51.2.9 maildir-uidlist.h, 1.17.2.3, 1.17.2.4
tss at dovecot.org
tss at dovecot.org
Wed Mar 21 21:22:37 EET 2007
Update of /var/lib/cvs/dovecot/src/lib-storage/index/maildir
In directory talvi:/tmp/cvs-serv17278/lib-storage/index/maildir
Modified Files:
Tag: branch_1_0
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.77.2.8
retrieving revision 1.77.2.9
diff -u -d -r1.77.2.8 -r1.77.2.9
--- maildir-sync.c 21 Mar 2007 19:19:49 -0000 1.77.2.8
+++ maildir-sync.c 21 Mar 2007 19:22:35 -0000 1.77.2.9
@@ -1230,7 +1230,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);
@@ -1280,11 +1280,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.51.2.8
retrieving revision 1.51.2.9
diff -u -d -r1.51.2.8 -r1.51.2.9
--- maildir-uidlist.c 19 Mar 2007 13:59:17 -0000 1.51.2.8
+++ maildir-uidlist.c 21 Mar 2007 19:22:35 -0000 1.51.2.9
@@ -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.17.2.3
retrieving revision 1.17.2.4
diff -u -d -r1.17.2.3 -r1.17.2.4
--- maildir-uidlist.h 22 Feb 2007 12:50:09 -0000 1.17.2.3
+++ maildir-uidlist.h 21 Mar 2007 19:22:35 -0000 1.17.2.4
@@ -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