dovecot-2.0: lib-storage: Moved mailbox_update() assert check fr...

dovecot at dovecot.org dovecot at dovecot.org
Wed Mar 16 17:59:09 EET 2011


details:   http://hg.dovecot.org/dovecot-2.0/rev/18d801449444
changeset: 12683:18d801449444
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Mar 16 17:59:07 2011 +0200
description:
lib-storage: Moved mailbox_update() assert check from mdbox to common, plus fixed it.

diffstat:

 src/lib-storage/index/dbox-multi/mdbox-storage.c |  2 --
 src/lib-storage/mail-storage.c                   |  4 ++++
 2 files changed, 4 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r ad393de782ce -r 18d801449444 src/lib-storage/index/dbox-multi/mdbox-storage.c
--- a/src/lib-storage/index/dbox-multi/mdbox-storage.c	Wed Mar 16 17:46:29 2011 +0200
+++ b/src/lib-storage/index/dbox-multi/mdbox-storage.c	Wed Mar 16 17:59:07 2011 +0200
@@ -229,8 +229,6 @@
 	    hdr->first_recent_uid < update->min_first_recent_uid) {
 		uint32_t first_recent_uid = update->min_first_recent_uid;
 
-		i_assert(update->min_next_uid == 0 ||
-			 first_recent_uid < update->min_next_uid);
 		mail_index_update_header(trans,
 			offsetof(struct mail_index_header, first_recent_uid),
 			&first_recent_uid, sizeof(first_recent_uid), FALSE);
diff -r ad393de782ce -r 18d801449444 src/lib-storage/mail-storage.c
--- a/src/lib-storage/mail-storage.c	Wed Mar 16 17:46:29 2011 +0200
+++ b/src/lib-storage/mail-storage.c	Wed Mar 16 17:59:07 2011 +0200
@@ -696,6 +696,10 @@
 
 int mailbox_update(struct mailbox *box, const struct mailbox_update *update)
 {
+	i_assert(update->min_next_uid == 0 ||
+		 update->min_first_recent_uid == 0 ||
+		 update->min_first_recent_uid <= update->min_next_uid);
+
 	return box->v.update(box, update);
 }
 


More information about the dovecot-cvs mailing list