Mercurial > dovecot > original-hg > dovecot-1.2
changeset 8139:f942af88598b HEAD
If imap.envelope is cached, use it instead of rebuilding it.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Sun, 31 Aug 2008 13:03:24 +0300 |
parents | e459274fc83f |
children | f8de4a912916 |
files | src/lib-storage/index/index-mail-headers.c |
diffstat | 1 files changed, 11 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/index/index-mail-headers.c Sun Aug 31 13:02:58 2008 +0300 +++ b/src/lib-storage/index/index-mail-headers.c Sun Aug 31 13:03:24 2008 +0300 @@ -447,9 +447,20 @@ int index_mail_headers_get_envelope(struct index_mail *mail) { + const unsigned int cache_field_envelope = + mail->ibox->cache_fields[MAIL_CACHE_IMAP_ENVELOPE].idx; struct mailbox_header_lookup_ctx *header_ctx; struct istream *stream; uoff_t old_offset; + string_t *str; + + str = str_new(mail->data_pool, 256); + if (mail_cache_lookup_field(mail->trans->cache_view, str, + mail->data.seq, cache_field_envelope) > 0) { + mail->data.envelope = str_c(str); + return 0; + } + str_free(&str); old_offset = mail->data.stream == NULL ? 0 : mail->data.stream->v_offset;