]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
pop3c: Remove unnecessarily duplicated code setting vsize to cache
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 22 Feb 2017 18:04:28 +0000 (20:04 +0200)
committerGitLab <gitlab@git.dovecot.net>
Wed, 22 Feb 2017 18:25:10 +0000 (20:25 +0200)
This is important now that the vsize can be added also to index's vsize
extension.

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

index b34cf78130dc915bdbd9ede51e04e9ab95bdf2e4..a5d2b63136b82d5cca741046cb1e045007ea794a 100644 (file)
@@ -110,22 +110,13 @@ static int pop3c_mail_get_physical_size(struct mail *_mail, uoff_t *size_r)
 
 static void pop3c_mail_cache_size(struct index_mail *mail)
 {
-       struct mail *_mail = &mail->mail.mail;
        uoff_t size;
-       unsigned int cache_idx;
 
        if (i_stream_get_size(mail->data.stream, TRUE, &size) <= 0)
                return;
        mail->data.virtual_size = size;
-
-       cache_idx = mail->ibox->cache_fields[MAIL_CACHE_VIRTUAL_FULL_SIZE].idx;
-       if (mail_cache_field_exists(_mail->transaction->cache_view,
-                                   _mail->seq, cache_idx) == 0) {
-               index_mail_cache_add_idx(mail, cache_idx, &size, sizeof(size));
-               /* make sure it's not cached twice */
-               mail->data.dont_cache_fetch_fields |=
-                       MAIL_CACHE_VIRTUAL_FULL_SIZE;
-       }
+       /* it'll be actually added to index when closing the mail in
+          index_mail_cache_sizes() */
 }
 
 static void