]> 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:01:41 +0000 (13:01 +0200)
src/lib-storage/index/index-mail.c

index b47d4afb370f523e6a1fac022039cba2a3c3cc73..8cb55172270be53d89a1c2b586e0fdbf2f5c7a26 100644 (file)
@@ -847,6 +847,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,