]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Add comment to how mail_cache_field_can/want_add() is used
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 25 Jan 2018 10:35:51 +0000 (12:35 +0200)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Mon, 5 Feb 2018 11:07:08 +0000 (13:07 +0200)
src/lib-storage/index/index-mail.c

index e12b9a2ab747b342c90dac300d47943ebc31227d..92a32948682283df82764abd2a461faa26aead32 100644 (file)
@@ -846,6 +846,10 @@ index_mail_want_cache(struct index_mail *mail, enum index_cache_field field)
        if ((mail->data.dont_cache_fetch_fields & fetch_field) != 0)
                return FALSE;
 
+       /* If a field has been explicitly requested to be fetched, it's
+          included in data.cache_fetch_fields. In that case use _can_add() to
+          add it to the cache file if at all possible. Otherwise, use
+          _want_add() to use previous caching decisions. */
        cache_field = mail->ibox->cache_fields[field].idx;
        if ((mail->data.cache_fetch_fields & fetch_field) != 0) {
                return mail_cache_field_can_add(_mail->transaction->cache_trans,