changeset 7199:24266b9a6c55 HEAD

Removed cache prev_offset optimization for now. It could have caused cache record loops.
author Timo Sirainen <tss@iki.fi>
date Wed, 30 Jan 2008 18:06:46 +0200
parents 7f7e295910a5
children c7f1cb8556be
files src/lib-index/mail-cache-transaction.c
diffstat 1 files changed, 4 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-cache-transaction.c	Sun Jan 27 20:27:59 2008 +0200
+++ b/src/lib-index/mail-cache-transaction.c	Wed Jan 30 18:06:46 2008 +0200
@@ -673,7 +673,6 @@
 	struct mail_cache_record *rec, new_rec;
 	void *data;
 	size_t size;
-	uint32_t reset_id;
 
 	if (ctx->prev_seq != 0) {
 		/* fix record size */
@@ -682,14 +681,10 @@
 		rec->size = size - ctx->prev_pos;
 		i_assert(rec->size > sizeof(*rec));
 
-		/* set prev_offset if possible */
-		rec->prev_offset =
-			mail_cache_lookup_cur_offset(ctx->view->view,
-						     ctx->prev_seq, &reset_id);
-		if (reset_id != ctx->cache->hdr->file_seq)
-			rec->prev_offset = 0;
-		else
-			ctx->cache->hdr_copy.continued_record_count++;
+		/* FIXME: here would be a good place to set prev_offset to
+		   avoid doing it later, but avoid circular prev_offsets
+		   when cache is updated multiple times within the same
+		   transaction */
 
 		array_append(&ctx->cache_data_seq, &ctx->prev_seq, 1);
 		ctx->prev_pos = size;