dovecot-2.1: doveadm, indexer: Don't crash if STATUS_LAST_CACHED...

dovecot at dovecot.org dovecot at dovecot.org
Mon Mar 25 15:56:40 EET 2013


details:   http://hg.dovecot.org/dovecot-2.1/rev/73feea4d22aa
changeset: 14937:73feea4d22aa
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Feb 22 10:31:38 2013 +0200
description:
doveadm, indexer: Don't crash if STATUS_LAST_CACHED_SEQ lookup fails.
(I'm sure I did this change already once, where did it go?..)

diffstat:

 src/doveadm/doveadm-mail-index.c |  6 +++---
 src/indexer/master-connection.c  |  7 +++----
 2 files changed, 6 insertions(+), 7 deletions(-)

diffs (35 lines):

diff -r eece943c7521 -r 73feea4d22aa src/doveadm/doveadm-mail-index.c
--- a/src/doveadm/doveadm-mail-index.c	Sun Mar 24 12:09:39 2013 +0200
+++ b/src/doveadm/doveadm-mail-index.c	Fri Feb 22 10:31:38 2013 +0200
@@ -38,10 +38,10 @@
 	int ret = 0;
 
 	if (mailbox_get_metadata(box, MAILBOX_METADATA_PRECACHE_FIELDS,
-				 &metadata) < 0)
+				 &metadata) < 0 ||
+	    mailbox_get_status(box, STATUS_MESSAGES | STATUS_LAST_CACHED_SEQ,
+			       &status) < 0)
 		return -1;
-	mailbox_get_open_status(box, STATUS_MESSAGES | STATUS_LAST_CACHED_SEQ,
-				&status);
 
 	seq = status.last_cached_seq + 1;
 	if (seq > status.messages) {
diff -r eece943c7521 -r 73feea4d22aa src/indexer/master-connection.c
--- a/src/indexer/master-connection.c	Sun Mar 24 12:09:39 2013 +0200
+++ b/src/indexer/master-connection.c	Fri Feb 22 10:31:38 2013 +0200
@@ -68,11 +68,10 @@
 	int ret = 0;
 
 	if (mailbox_get_metadata(box, MAILBOX_METADATA_PRECACHE_FIELDS,
-				 &metadata) < 0)
+				 &metadata) < 0 ||
+	    mailbox_get_status(box, STATUS_MESSAGES | STATUS_LAST_CACHED_SEQ,
+			       &status) < 0)
 		return -1;
-
-	mailbox_get_open_status(box, STATUS_MESSAGES | STATUS_LAST_CACHED_SEQ,
-				&status);
 	seq = status.last_cached_seq + 1;
 
 	trans = mailbox_transaction_begin(box, MAILBOX_TRANSACTION_FLAG_NO_CACHE_DEC);


More information about the dovecot-cvs mailing list