dovecot: Make sure cache is opened when mail_cache_field_can_add...

dovecot at dovecot.org dovecot at dovecot.org
Thu Jul 12 06:41:12 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/731be87a2128
changeset: 5966:731be87a2128
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Jul 12 06:40:51 2007 +0300
description:
Make sure cache is opened when mail_cache_field_can_add() or
mail_cache_field_want_add() is called.

diffstat:

1 file changed, 6 insertions(+)
src/lib-index/mail-cache-transaction.c |    6 ++++++

diffs (23 lines):

diff -r 921bc18b164a -r 731be87a2128 src/lib-index/mail-cache-transaction.c
--- a/src/lib-index/mail-cache-transaction.c	Thu Jul 12 06:15:49 2007 +0300
+++ b/src/lib-index/mail-cache-transaction.c	Thu Jul 12 06:40:51 2007 +0300
@@ -815,6 +815,9 @@ bool mail_cache_field_want_add(struct ma
 {
 	enum mail_cache_decision_type decision;
 
+	if (!ctx->cache->opened)
+		(void)mail_cache_open_and_verify(ctx->cache);
+
 	decision = mail_cache_field_get_decision(ctx->view->cache, field_idx);
 	if ((decision & ~MAIL_CACHE_DECISION_FORCED) == MAIL_CACHE_DECISION_NO)
 		return FALSE;
@@ -826,6 +829,9 @@ bool mail_cache_field_can_add(struct mai
 			      uint32_t seq, unsigned int field_idx)
 {
 	enum mail_cache_decision_type decision;
+
+	if (!ctx->cache->opened)
+		(void)mail_cache_open_and_verify(ctx->cache);
 
 	decision = mail_cache_field_get_decision(ctx->view->cache, field_idx);
 	if (decision == (MAIL_CACHE_DECISION_FORCED | MAIL_CACHE_DECISION_NO))


More information about the dovecot-cvs mailing list