dovecot-1.2: mail_set_seq(): Don't open input stream immediately...
dovecot at dovecot.org
dovecot at dovecot.org
Tue Dec 16 06:08:31 EET 2008
details: http://hg.dovecot.org/dovecot-1.2/rev/94e0fda6802e
changeset: 8558:94e0fda6802e
user: Timo Sirainen <tss at iki.fi>
date: Tue Dec 16 06:08:26 2008 +0200
description:
mail_set_seq(): Don't open input stream immediately if message hasn't been saved yet.
diffstat:
1 file changed, 7 insertions(+), 2 deletions(-)
src/lib-storage/index/index-mail.c | 9 +++++++--
diffs (26 lines):
diff -r 076ccdcbbeb2 -r 94e0fda6802e src/lib-storage/index/index-mail.c
--- a/src/lib-storage/index/index-mail.c Tue Dec 16 05:30:31 2008 +0200
+++ b/src/lib-storage/index/index-mail.c Tue Dec 16 06:08:26 2008 +0200
@@ -1181,7 +1181,8 @@ void index_mail_set_seq(struct mail *_ma
struct index_mail *mail = (struct index_mail *)_mail;
struct index_mail_data *data = &mail->data;
struct mail_cache_field *cache_fields = mail->ibox->cache_fields;
- struct mail_cache_view *cache_view = mail->trans->cache_view;
+ struct mail_cache_view *cache_view = mail->trans->cache_view;
+ const struct mail_index_header *hdr;
struct istream *input;
if (data->seq == seq)
@@ -1287,7 +1288,11 @@ void index_mail_set_seq(struct mail *_ma
if ((mail->wanted_fields & MAIL_FETCH_STREAM_BODY) != 0)
data->access_part |= READ_BODY;
- (void)mail_get_stream(_mail, NULL, NULL, &input);
+ /* open the stream only if we didn't get here from
+ mailbox_save_init() */
+ hdr = mail_index_get_header(mail->ibox->view);
+ if (_mail->uid != 0 && _mail->uid < hdr->next_uid)
+ (void)mail_get_stream(_mail, NULL, NULL, &input);
}
}
More information about the dovecot-cvs
mailing list