dovecot-2.0: dbox: Use mail's transaction view instead of mailbo...
dovecot at dovecot.org
dovecot at dovecot.org
Fri Mar 19 15:19:51 EET 2010
details: http://hg.dovecot.org/dovecot-2.0/rev/ae9d00b1ffdd
changeset: 10948:ae9d00b1ffdd
user: Timo Sirainen <tss at iki.fi>
date: Fri Mar 19 15:19:49 2010 +0200
description:
dbox: Use mail's transaction view instead of mailbox's view whenever possible.
This fixes crash when saving/copying fails.
diffstat:
src/lib-storage/index/dbox-multi/mdbox-mail.c | 6 +++---
src/lib-storage/index/dbox-multi/mdbox-save.c | 4 ++--
src/lib-storage/index/dbox-single/sdbox-mail.c | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)
diffs (63 lines):
diff -r d133801d8e83 -r ae9d00b1ffdd src/lib-storage/index/dbox-multi/mdbox-mail.c
--- a/src/lib-storage/index/dbox-multi/mdbox-mail.c Fri Mar 19 15:15:43 2010 +0200
+++ b/src/lib-storage/index/dbox-multi/mdbox-mail.c Fri Mar 19 15:19:49 2010 +0200
@@ -62,7 +62,7 @@
struct mdbox_mailbox *mbox = (struct mdbox_mailbox *)_mail->box;
(void)mail_index_refresh(_mail->box->index);
- if (mail_index_is_expunged(_mail->box->view, _mail->seq)) {
+ if (mail_index_is_expunged(_mail->transaction->view, _mail->seq)) {
mail_set_expunged(_mail);
return;
}
@@ -114,7 +114,7 @@
if (mail->open_file != NULL) {
/* already open */
} else if (_mail->uid != 0) {
- if (mdbox_mail_lookup(mbox, _mail->box->view,
+ if (mdbox_mail_lookup(mbox, _mail->transaction->view,
_mail->seq, &map_uid) < 0)
return -1;
if (dbox_mail_open_init(mail, map_uid) < 0)
@@ -160,7 +160,7 @@
const void *data;
bool expunged;
- mail_index_lookup_ext(mail->box->view, mail->seq,
+ mail_index_lookup_ext(mail->transaction->view, mail->seq,
mbox->ext_id, &data, &expunged);
dbox_rec = data;
if (dbox_rec == NULL || dbox_rec->map_uid == 0) {
diff -r d133801d8e83 -r ae9d00b1ffdd src/lib-storage/index/dbox-multi/mdbox-save.c
--- a/src/lib-storage/index/dbox-multi/mdbox-save.c Fri Mar 19 15:15:43 2010 +0200
+++ b/src/lib-storage/index/dbox-multi/mdbox-save.c Fri Mar 19 15:19:49 2010 +0200
@@ -368,7 +368,7 @@
memset(&rec, 0, sizeof(rec));
rec.save_date = ioloop_time;
- if (mdbox_mail_lookup(src_mbox, mail->box->view, mail->seq,
+ if (mdbox_mail_lookup(src_mbox, mail->transaction->view, mail->seq,
&rec.map_uid) < 0)
return -1;
@@ -382,7 +382,7 @@
mail_index_update_ext(ctx->ctx.trans, ctx->ctx.seq,
ctx->mbox->ext_id, &rec, NULL);
- mail_index_lookup_ext(mail->box->view, mail->seq,
+ mail_index_lookup_ext(mail->transaction->view, mail->seq,
src_mbox->guid_ext_id, &data, &expunged);
if (data != NULL) {
mail_index_update_ext(ctx->ctx.trans, ctx->ctx.seq,
diff -r d133801d8e83 -r ae9d00b1ffdd src/lib-storage/index/dbox-single/sdbox-mail.c
--- a/src/lib-storage/index/dbox-single/sdbox-mail.c Fri Mar 19 15:15:43 2010 +0200
+++ b/src/lib-storage/index/dbox-single/sdbox-mail.c Fri Mar 19 15:19:49 2010 +0200
@@ -18,7 +18,7 @@
struct sdbox_mailbox *mbox = (struct sdbox_mailbox *)_mail->box;
(void)mail_index_refresh(_mail->box->index);
- if (mail_index_is_expunged(_mail->box->view, _mail->seq)) {
+ if (mail_index_is_expunged(_mail->transaction->view, _mail->seq)) {
mail_set_expunged(_mail);
return;
}
More information about the dovecot-cvs
mailing list