]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Make sure initial_modseq is correct when rotating transaction log.
authorTimo Sirainen <tss@iki.fi>
Tue, 17 Jun 2008 01:51:40 +0000 (04:51 +0300)
committerTimo Sirainen <tss@iki.fi>
Tue, 17 Jun 2008 01:51:40 +0000 (04:51 +0300)
--HG--
branch : HEAD

src/lib-index/mail-transaction-log-file.c

index 582fd80a4dcfb5d20fdb44e8d7d2ecad329067ed..039679d2e1055da77dd94f6e5b5fd5bb2307ca7d 100644 (file)
@@ -185,9 +185,15 @@ mail_transaction_log_init_hdr(struct mail_transaction_log *log,
                hdr->file_seq = 1;
        }
 
-       if (log->head != NULL && hdr->file_seq <= log->head->hdr.file_seq) {
-               /* make sure the sequence grows */
-               hdr->file_seq = log->head->hdr.file_seq+1;
+       if (log->head != NULL) {
+               if (hdr->file_seq <= log->head->hdr.file_seq) {
+                       /* make sure the sequence grows */
+                       hdr->file_seq = log->head->hdr.file_seq+1;
+               }
+               if (hdr->initial_modseq < log->head->sync_highest_modseq) {
+                       /* this should be always up-to-date */
+                       hdr->initial_modseq = log->head->sync_highest_modseq;
+               }
        }
        return 0;
 }