From 232ee7c662e20e7cc4fd6ee18b7f7e1c9299f96a Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Fri, 26 Sep 2014 00:32:03 +0300 Subject: [PATCH] lib-storage: Don't assume that we must read the whole message to get its virtual size. This is true only with mbox format. All the other formats have various metadata available where it's stored. --- src/lib-storage/index/index-mail.c | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/lib-storage/index/index-mail.c b/src/lib-storage/index/index-mail.c index 6950d83d8e..80fc4bbf8d 100644 --- a/src/lib-storage/index/index-mail.c +++ b/src/lib-storage/index/index-mail.c @@ -1538,21 +1538,6 @@ static void index_mail_update_access_parts(struct index_mail *mail) (void)mail_get_hdr_stream(_mail, NULL, &input); } } - - if ((data->wanted_fields & MAIL_FETCH_VIRTUAL_SIZE) != 0 && - data->virtual_size == (uoff_t)-1 && - _mail->lookup_abort == MAIL_LOOKUP_ABORT_NEVER && - ((data->access_part & (READ_HDR | PARSE_HDR)) == 0 || - (data->access_part & (READ_BODY | PARSE_BODY)) == 0)) { - /* we want virtual size, and we'd prefer not to read the entire - message for it. see if it's possible. */ - uoff_t vsize; - - _mail->lookup_abort = MAIL_LOOKUP_ABORT_NOT_IN_CACHE; - if (mail_get_virtual_size(_mail, &vsize) < 0) - mail->data.access_part |= READ_HDR | READ_BODY; - _mail->lookup_abort = MAIL_LOOKUP_ABORT_NEVER; - } } void index_mail_set_seq(struct mail *_mail, uint32_t seq, bool saving) -- 2.47.3