dovecot-2.2: lib-storage: mailbox_get_status() no longer forces ...

dovecot at dovecot.org dovecot at dovecot.org
Sun Mar 31 17:25:24 EEST 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/12136db6e31f
changeset: 16129:12136db6e31f
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Mar 31 17:24:35 2013 +0300
description:
lib-storage: mailbox_get_status() no longer forces mailbox to be synced.
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.

diffstat:

 src/lib-storage/index/index-status.c |  2 --
 src/lib-storage/mail-storage.h       |  5 ++++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r f31d241d5371 -r 12136db6e31f src/lib-storage/index/index-status.c
--- a/src/lib-storage/index/index-status.c	Sun Mar 31 16:46:45 2013 +0300
+++ b/src/lib-storage/index/index-status.c	Sun Mar 31 17:24:35 2013 +0300
@@ -36,8 +36,6 @@
 	if (!box->opened) {
 		if (mailbox_open(box) < 0)
 			return -1;
-	}
-	if (!box->synced) {
 		if (mailbox_sync(box, MAILBOX_SYNC_FLAG_FAST) < 0)
 			return -1;
 	}
diff -r f31d241d5371 -r 12136db6e31f src/lib-storage/mail-storage.h
--- a/src/lib-storage/mail-storage.h	Sun Mar 31 16:46:45 2013 +0300
+++ b/src/lib-storage/mail-storage.h	Sun Mar 31 17:24:35 2013 +0300
@@ -541,7 +541,10 @@
    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. */


More information about the dovecot-cvs mailing list