changeset 8602:06c641b17175 HEAD

mbox: Fixed assert-crash with pop3_lock_session=yes
author Timo Sirainen <tss@iki.fi>
date Thu, 08 Jan 2009 14:47:58 -0500
parents da02a1d15783
children fe4b8c4a6922
files src/lib-storage/index/mbox/mbox-transaction.c
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/mbox/mbox-transaction.c	Thu Jan 08 12:22:11 2009 -0500
+++ b/src/lib-storage/index/mbox/mbox-transaction.c	Thu Jan 08 14:47:58 2009 -0500
@@ -50,8 +50,12 @@
 		if (mbox_unlock(mbox, lock_id) < 0)
 			ret = -1;
 	}
-	i_assert(mbox->ibox.box.transaction_count > 0 ||
-		 mbox->mbox_lock_type == F_UNLCK);
+	if (mbox->mbox_global_lock_id == 0) {
+		i_assert(mbox->ibox.box.transaction_count > 0 ||
+			 mbox->mbox_lock_type == F_UNLCK);
+	} else {
+		i_assert(mbox->mbox_lock_type == F_WRLCK);
+	}
 	return ret;
 }