changeset 6295:30904b20782d HEAD

Make sure we don't try to re-read cache fields when compressing.
author Timo Sirainen <tss@iki.fi>
date Mon, 13 Aug 2007 20:16:07 +0300
parents 10a5f61d9692
children 205ee38f10d1
files src/lib-index/mail-cache-lookup.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-cache-lookup.c	Mon Aug 13 20:05:41 2007 +0300
+++ b/src/lib-index/mail-cache-lookup.c	Mon Aug 13 20:16:07 2007 +0300
@@ -199,9 +199,11 @@
 
 	if (file_field >= cache->file_fields_count) {
 		/* new field, have to re-read fields header to figure
-		   out its size */
-		if (mail_cache_header_fields_read(cache) < 0)
-			return -1;
+		   out its size. don't do this if we're compressing. */
+		if (!cache->locked) {
+			if (mail_cache_header_fields_read(cache) < 0)
+				return -1;
+		}
 		if (file_field >= cache->file_fields_count) {
 			mail_cache_set_corrupted(cache,
 				"field index too large (%u >= %u)",