]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
partial syncing fixes
authorTimo Sirainen <tss@iki.fi>
Wed, 23 Jun 2004 06:09:00 +0000 (09:09 +0300)
committerTimo Sirainen <tss@iki.fi>
Wed, 23 Jun 2004 06:09:00 +0000 (09:09 +0300)
--HG--
branch : HEAD

src/lib-storage/index/maildir/maildir-sync.c

index 353bbd100fbc49b9713525263d1f71da0a34c42c..7bbc501334a97545094da95b888bd5fddeb60677 100644 (file)
@@ -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. */