From: Timo Sirainen Date: Thu, 12 Aug 2010 15:53:04 +0000 (+0100) Subject: lib-index: Added mail_cache_reset(). X-Git-Tag: 2.0.rc6~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d35fee8d1e5e31614dba5e64d45ed23c7d6bfa53;p=thirdparty%2Fdovecot%2Fcore.git lib-index: Added mail_cache_reset(). --- diff --git a/src/lib-index/mail-cache.c b/src/lib-index/mail-cache.c index 9c8c749ff9..1605be1bc8 100644 --- a/src/lib-index/mail-cache.c +++ b/src/lib-index/mail-cache.c @@ -25,14 +25,18 @@ static void mail_cache_unlink(struct mail_cache *cache) (void)unlink(cache->filepath); } -void mail_cache_set_corrupted(struct mail_cache *cache, const char *fmt, ...) +void mail_cache_reset(struct mail_cache *cache) { - va_list va; - mail_cache_unlink(cache); - /* mark the cache as unusable */ cache->hdr = NULL; +} + +void mail_cache_set_corrupted(struct mail_cache *cache, const char *fmt, ...) +{ + va_list va; + + mail_cache_reset(cache); va_start(va, fmt); T_BEGIN { diff --git a/src/lib-index/mail-cache.h b/src/lib-index/mail-cache.h index 21e3303a1c..ca1b5f676b 100644 --- a/src/lib-index/mail-cache.h +++ b/src/lib-index/mail-cache.h @@ -112,5 +112,7 @@ int mail_cache_lookup_headers(struct mail_cache_view *view, string_t *dest, /* "Error in index cache file %s: ...". */ void mail_cache_set_corrupted(struct mail_cache *cache, const char *fmt, ...) ATTR_FORMAT(2, 3); +/* Delete the cache file. */ +void mail_cache_reset(struct mail_cache *cache); #endif