]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Set index_mail_data.body_size if it can be calculated easily
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 4 Jun 2018 16:16:04 +0000 (19:16 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 4 Jun 2018 19:22:36 +0000 (19:22 +0000)
Probably doesn't help with anything currently, but makes the code more
consistent in how it works.

src/lib-storage/index/index-mail.c

index 52d74d4c199eb5b41878c2a4b07946566f177732..23c09ce82349f3fc443c243256fad12f0958c374 100644 (file)
@@ -1321,6 +1321,10 @@ int index_mail_init_stream(struct index_mail *mail,
                        /* the sizes were just calculated */
                        data->inexact_total_sizes = FALSE;
                }
+       } else {
+               /* If body_size==NULL, the caller doesn't care about it.
+                  However, try to set it anyway if it can be calculated. */
+               index_mail_try_set_body_size(mail);
        }
        ret = index_mail_stream_check_failure(mail);