]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imapc: Don't send NOOP on sync if MAILBOX_SYNC_FLAG_FAST is set
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 26 Apr 2017 20:13:20 +0000 (23:13 +0300)
committerGitLab <gitlab@git.dovecot.net>
Thu, 27 Apr 2017 07:00:57 +0000 (10:00 +0300)
Fast syncing should do only the minimal amount of work.

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

index 2deef70f3e042812007bab15ec396381c5fc73d2..3502cd361bddaa6c2a1ce57a153a357b7e2b89f9 100644 (file)
@@ -547,8 +547,9 @@ imapc_noop_if_needed(struct imapc_mailbox *mbox, enum mailbox_sync_flags flags)
        if (!mbox->initial_sync_done) {
                /* we just SELECTed/EXAMINEd the mailbox, don't do another
                   NOOP. */
-       } else if ((mbox->capabilities & IMAPC_CAPABILITY_IDLE) == 0 ||
-                  (flags & MAILBOX_SYNC_FLAG_FULL_READ) != 0) {
+       } else if ((flags & MAILBOX_SYNC_FLAG_FAST) == 0 &&
+                  ((mbox->capabilities & IMAPC_CAPABILITY_IDLE) == 0 ||
+                   (flags & MAILBOX_SYNC_FLAG_FULL_READ) != 0)) {
                /* do NOOP to make sure we have the latest changes before
                   starting sync. this is necessary either because se don't
                   support IDLE at all, or because we want to be sure that we