From: Timo Sirainen Date: Thu, 8 Jan 2009 19:47:58 +0000 (-0500) Subject: mbox: Fixed assert-crash with pop3_lock_session=yes X-Git-Tag: 1.2.beta1~141 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c94204496fd93aa5df2329052fa51419ccb5026c;p=thirdparty%2Fdovecot%2Fcore.git mbox: Fixed assert-crash with pop3_lock_session=yes --HG-- branch : HEAD --- diff --git a/src/lib-storage/index/mbox/mbox-transaction.c b/src/lib-storage/index/mbox/mbox-transaction.c index 815d2656ed..c5f0c1c027 100644 --- a/src/lib-storage/index/mbox/mbox-transaction.c +++ b/src/lib-storage/index/mbox/mbox-transaction.c @@ -50,8 +50,12 @@ static int mbox_transaction_commit(struct mail_index_transaction *t, 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; }