Mercurial > dovecot > core-2.2
changeset 11650:267ad2b32276 HEAD
lib-storage: Use mail->saving, not mail->uid==0 to check if mail is being saved.
The uid may be non-zero when saving with dsync.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Mon, 28 Jun 2010 21:34:45 +0100 |
parents | 6cce8b2a9121 |
children | 243166e7dd2d |
files | src/lib-storage/index/index-mail.c src/lib-storage/index/maildir/maildir-mail.c src/plugins/zlib/zlib-plugin.c |
diffstat | 3 files changed, 7 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/index/index-mail.c Mon Jun 28 17:58:47 2010 +0100 +++ b/src/lib-storage/index/index-mail.c Mon Jun 28 21:34:45 2010 +0100 @@ -1320,7 +1320,7 @@ /* open the stream only if we didn't get here from mailbox_save_init() */ hdr = mail_index_get_header(_mail->box->view); - if (_mail->uid != 0 && _mail->uid < hdr->next_uid) + if (!_mail->saving && _mail->uid < hdr->next_uid) (void)mail_get_stream(_mail, NULL, NULL, &input); } }
--- a/src/lib-storage/index/maildir/maildir-mail.c Mon Jun 28 17:58:47 2010 +0100 +++ b/src/lib-storage/index/maildir/maildir-mail.c Mon Jun 28 21:34:45 2010 +0100 @@ -118,7 +118,7 @@ if (stp == NULL) return -1; *st = *stp; - } else if (mail->uid != 0) { + } else if (!mail->saving) { imail->mail.stats_stat_lookup_count++; ret = maildir_file_do(mbox, mail->uid, do_stat, st); if (ret <= 0) { @@ -274,7 +274,7 @@ enum maildir_uidlist_rec_ext_key key; const char *path, *fname, *value; - if (_mail->uid != 0) { + if (!_mail->saving) { if (maildir_mail_get_fname(mbox, _mail, &fname) <= 0) return -1; } else { @@ -292,7 +292,7 @@ return 1; /* size can be included in uidlist entry */ - if (_mail->uid != 0) { + if (!_mail->saving) { key = vsize ? MAILDIR_UIDLIST_REC_EXT_VSIZE : MAILDIR_UIDLIST_REC_EXT_PSIZE; value = maildir_uidlist_lookup_ext(mbox->uidlist, _mail->uid, @@ -411,7 +411,7 @@ return 0; } - if (_mail->uid != 0) { + if (!_mail->saving) { ret = maildir_file_do(mbox, _mail->uid, do_stat, &st); if (ret <= 0) { if (ret == 0) @@ -450,7 +450,7 @@ *value_r = mail->data.guid; return 0; } - if (_mail->uid != 0) { + if (!_mail->saving) { if (maildir_mail_get_fname(mbox, _mail, &fname) <= 0) return -1; } else {
--- a/src/plugins/zlib/zlib-plugin.c Mon Jun 28 17:58:47 2010 +0100 +++ b/src/plugins/zlib/zlib-plugin.c Mon Jun 28 21:34:45 2010 +0100 @@ -143,7 +143,7 @@ in such situation we're probably checking if the user-given input looks compressed */ if (imail->data.stream != NULL || - (_mail->uid == 0 && zuser->save_handler == NULL)) { + (_mail->saving && zuser->save_handler == NULL)) { return zmail->super.get_stream(_mail, hdr_size, body_size, stream_r); }