changeset 1831:e018d6b0a3df HEAD

compression could have broken header lists
author Timo Sirainen <tss@iki.fi>
date Tue, 21 Oct 2003 06:25:03 +0300
parents 27cc6681ea3e
children fece302386f4
files src/lib-index/mail-cache.c
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-cache.c	Tue Oct 21 06:14:44 2003 +0300
+++ b/src/lib-index/mail-cache.c	Tue Oct 21 06:25:03 2003 +0300
@@ -784,8 +784,15 @@
 		if (!mmap_update(cache, 0, 0))
 			ret = FALSE;
 	}
-	cache->index->header->flags &= ~(MAIL_INDEX_HDR_FLAG_REBUILD |
-					 MAIL_INDEX_HDR_FLAG_COMPRESS_CACHE);
+
+	/* headers could have changed, reread them */
+	memset(cache->split_offsets, 0, sizeof(cache->split_offsets));
+
+	if (ret) {
+		cache->index->header->flags &=
+			~(MAIL_INDEX_HDR_FLAG_REBUILD |
+			  MAIL_INDEX_HDR_FLAG_COMPRESS_CACHE);
+	}
 
 	if (!mail_cache_unlock(cache))
 		ret = FALSE;