]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: Added mail_cache_reset().
authorTimo Sirainen <tss@iki.fi>
Thu, 12 Aug 2010 15:53:04 +0000 (16:53 +0100)
committerTimo Sirainen <tss@iki.fi>
Thu, 12 Aug 2010 15:53:04 +0000 (16:53 +0100)
src/lib-index/mail-cache.c
src/lib-index/mail-cache.h

index 9c8c749ff912e1c7655cec6ea0f390164f4c954f..1605be1bc80d7af768470053906425acc0d476e4 100644 (file)
@@ -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 {
index 21e3303a1c27d89b419c7cc010c2324902996a6d..ca1b5f676bb0d210423797baa75a5f0e7434fd7f 100644 (file)
@@ -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