From a33fde36c57839342dafdf3c8d4b5c009e3ef4bc Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Wed, 23 Jun 2004 09:09:00 +0300 Subject: [PATCH] partial syncing fixes --HG-- branch : HEAD --- src/lib-storage/index/maildir/maildir-sync.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/lib-storage/index/maildir/maildir-sync.c b/src/lib-storage/index/maildir/maildir-sync.c index 353bbd100f..7bbc501334 100644 --- a/src/lib-storage/index/maildir/maildir-sync.c +++ b/src/lib-storage/index/maildir/maildir-sync.c @@ -642,10 +642,6 @@ static int maildir_sync_index(struct maildir_sync_context *ctx) __again: seq++; - if ((uflags & MAILDIR_UIDLIST_REC_FLAG_NONSYNCED) != 0) { - /* partial syncing */ - continue; - } if (seq > hdr->messages_count) { if (uid < hdr->next_uid) { @@ -658,6 +654,11 @@ static int maildir_sync_index(struct maildir_sync_context *ctx) the difference between this and the later check is that this one happens when messages are expunged from the end */ + if ((uflags & + MAILDIR_UIDLIST_REC_FLAG_NONSYNCED) != 0) { + /* partial syncing */ + continue; + } if ((uflags & MAILDIR_UIDLIST_REC_FLAG_RACING) != 0) { mail_storage_set_critical( @@ -703,6 +704,12 @@ static int maildir_sync_index(struct maildir_sync_context *ctx) committed changes to index. so, this message shouldn't actually exist. mark it racy and check in next sync. */ + if ((uflags & + MAILDIR_UIDLIST_REC_FLAG_NONSYNCED) != 0) { + /* partial syncing */ + seq--; + continue; + } if ((uflags & MAILDIR_UIDLIST_REC_FLAG_RACING) != 0) { mail_storage_set_critical(ibox->box.storage, "Maildir %s sync: UID inserted in the " @@ -722,6 +729,11 @@ static int maildir_sync_index(struct maildir_sync_context *ctx) continue; } + if ((uflags & MAILDIR_UIDLIST_REC_FLAG_NONSYNCED) != 0) { + /* partial syncing */ + continue; + } + if ((rec->flags & MAIL_INDEX_MAIL_FLAG_DIRTY) != 0) { /* we haven't been able to update maildir with this record's flag changes. don't sync them. */ -- 2.47.3