changeset 22796:32db0c418fd2

lib-storage: Add comment to how mail_cache_field_can/want_add() is used
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Thu, 25 Jan 2018 12:35:51 +0200
parents 105a2e1fd770
children 2c72506cd19a
files src/lib-storage/index/index-mail.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/index-mail.c	Thu Jan 25 12:35:35 2018 +0200
+++ b/src/lib-storage/index/index-mail.c	Thu Jan 25 12:35:51 2018 +0200
@@ -846,6 +846,10 @@
 	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,