changeset 5955:ce960c33f663 HEAD

Fixes
author Timo Sirainen <tss@iki.fi>
date Thu, 12 Jul 2007 03:21:07 +0300
parents b788251996e5
children fc75386a57ab
files src/lib-index/mail-cache-lookup.c
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-cache-lookup.c	Thu Jul 12 03:20:57 2007 +0300
+++ b/src/lib-index/mail-cache-lookup.c	Thu Jul 12 03:21:07 2007 +0300
@@ -78,6 +78,11 @@
 		if (++i == 2)
 			return 0;
 
+		if (cache->locked) {
+			/* we're probably compressing */
+			return 0;
+		}
+
 		if ((ret = mail_cache_reopen(cache)) <= 0) {
 			/* error / we already have the latest file open */
 			return ret;
@@ -117,7 +122,7 @@
 	if (!MAIL_CACHE_IS_UNUSABLE(view->cache)) {
 		/* look up the first offset */
 		if (mail_cache_lookup_offset(view->cache, view->view, seq,
-					     &ctx->offset) < 0)
+					     &ctx->offset) <= 0)
 			ctx->failed = TRUE;
 	}
 	ctx->remap_counter = view->cache->remap_counter;