dovecot-1.2: CONDSTORE: Return HIGHESTMODSEQ correctly even if i...

dovecot at dovecot.org dovecot at dovecot.org
Sat Jun 21 15:06:52 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.2/rev/b4286cde68d0
changeset: 7930:b4286cde68d0
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Jun 21 14:03:59 2008 +0300
description:
CONDSTORE: Return HIGHESTMODSEQ correctly even if indexes are in memory.

diffstat:

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

diffs (38 lines):

diff -r 55d1a2bf4573 -r b4286cde68d0 src/imap/cmd-select.c
--- a/src/imap/cmd-select.c	Sat Jun 21 13:48:42 2008 +0300
+++ b/src/imap/cmd-select.c	Sat Jun 21 14:03:59 2008 +0300
@@ -305,7 +305,7 @@ select_open(struct imap_select_context *
 			 t_strdup_printf("* OK [UIDNEXT %u] Predicted next UID",
 					 status.uidnext));
 
-	if (status.highest_modseq == 0) {
+	if (status.nonpermanent_modseqs) {
 		client_send_line(client,
 				 "* OK [NOMODSEQ] No permanent modsequences");
 	} else {
diff -r 55d1a2bf4573 -r b4286cde68d0 src/lib-storage/index/index-status.c
--- a/src/lib-storage/index/index-status.c	Sat Jun 21 13:48:42 2008 +0300
+++ b/src/lib-storage/index/index-status.c	Sat Jun 21 14:03:59 2008 +0300
@@ -26,8 +26,8 @@ void index_storage_get_status(struct mai
 	status_r->unseen = hdr->messages_count - hdr->seen_messages_count;
 	status_r->uidvalidity = hdr->uid_validity;
 	status_r->uidnext = hdr->next_uid;
-	if ((items & STATUS_HIGHESTMODSEQ) != 0 &&
-	    !mail_index_is_in_memory(ibox->index)) {
+	status_r->nonpermanent_modseqs = mail_index_is_in_memory(ibox->index);
+	if ((items & STATUS_HIGHESTMODSEQ) != 0) {
 		status_r->highest_modseq =
 			mail_index_modseq_get_highest(ibox->view);
 	}
diff -r 55d1a2bf4573 -r b4286cde68d0 src/lib-storage/mail-storage.h
--- a/src/lib-storage/mail-storage.h	Sat Jun 21 13:48:42 2008 +0300
+++ b/src/lib-storage/mail-storage.h	Sat Jun 21 14:03:59 2008 +0300
@@ -193,6 +193,8 @@ struct mailbox_status {
 
 	/* There are expunges that haven't been synced yet */
 	unsigned int sync_delayed_expunges:1;
+	/* Modseqs aren't permanent (index is in memory) */
+	unsigned int nonpermanent_modseqs:1;
 };
 
 struct mailbox_sync_rec {


More information about the dovecot-cvs mailing list