]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: mailbox_get_status() no longer forces mailbox to be synced.
authorTimo Sirainen <tss@iki.fi>
Sun, 31 Mar 2013 14:24:35 +0000 (17:24 +0300)
committerTimo Sirainen <tss@iki.fi>
Sun, 31 Mar 2013 14:24:35 +0000 (17:24 +0300)
This fixes copying messages with keywords to a virtual mailbox, where
syncing happened too late and caused assert-crash (status was only used to
lookup list of keywords).

The crash could have been solved another way too, but it's probably better
if automatic syncing isn't always performed. doveadm index -n parameter
handling also relies on this behavior.

src/lib-storage/index/index-status.c
src/lib-storage/mail-storage.h

index 19bb411507bae7368a74f2d448d9714a9279c7ae..1e7d5d7e29cb532f55c63efbc47ed7d43401351e 100644 (file)
@@ -36,8 +36,6 @@ int index_storage_get_status(struct mailbox *box,
        if (!box->opened) {
                if (mailbox_open(box) < 0)
                        return -1;
-       }
-       if (!box->synced) {
                if (mailbox_sync(box, MAILBOX_SYNC_FLAG_FAST) < 0)
                        return -1;
        }
index 0d2d6cc42c56c4c95726a1cc89bc11d453067ea5..4e414a53d8bc4a791b968a88f66af7a0f053ebd9 100644 (file)
@@ -541,7 +541,10 @@ bool mailbox_backends_equal(const struct mailbox *box1,
    do forced CLOSE. */
 bool mailbox_is_inconsistent(struct mailbox *box);
 
-/* Gets the mailbox status information, opening the mailbox if necessary. */
+/* Gets the mailbox status information. If mailbox isn't opened yet, try to
+   return the results from mailbox list indexes. Otherwise the mailbox is
+   opened and synced. If the mailbox is already opened, no syncing is done
+   automatically. */
 int mailbox_get_status(struct mailbox *box, enum mailbox_status_items items,
                       struct mailbox_status *status_r);
 /* Gets the mailbox status, requires that mailbox is already opened. */