From: Timo Sirainen Date: Mon, 8 Mar 2010 17:39:43 +0000 (+0200) Subject: dbox: Don't assert-crash if trying to read a mail that's being saved. X-Git-Tag: 2.0.beta4~103 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d665e2948cb6fe8016706752a9e4940d64f4a61d;p=thirdparty%2Fdovecot%2Fcore.git dbox: Don't assert-crash if trying to read a mail that's being saved. --HG-- branch : HEAD --- diff --git a/src/lib-storage/index/dbox-single/sdbox-mail.c b/src/lib-storage/index/dbox-single/sdbox-mail.c index 5390bd5a27..01468fe014 100644 --- a/src/lib-storage/index/dbox-single/sdbox-mail.c +++ b/src/lib-storage/index/dbox-single/sdbox-mail.c @@ -32,6 +32,8 @@ static bool sdbox_mail_file_set(struct dbox_mail *mail) { struct mail *_mail = &mail->imail.mail.mail; struct sdbox_mailbox *mbox = (struct sdbox_mailbox *)_mail->box; + bool deleted; + int ret; if (mail->open_file != NULL) { /* already set */ @@ -45,6 +47,10 @@ static bool sdbox_mail_file_set(struct dbox_mail *mail) sdbox_save_file_get_file(_mail->transaction, _mail->seq); mail->open_file->refcount++; + + /* it doesn't have input stream yet */ + ret = dbox_file_open(mail->open_file, &deleted); + i_assert(ret > 0); return TRUE; } }