[dovecot-cvs] dovecot/src/lib-index mail-cache-lookup.c, 1.37, 1.38 mail-cache-private.h, 1.37, 1.38

tss at dovecot.org tss at dovecot.org
Sun Jan 14 03:17:10 UTC 2007


Update of /var/lib/cvs/dovecot/src/lib-index
In directory talvi:/tmp/cvs-serv17617

Modified Files:
	mail-cache-lookup.c mail-cache-private.h 
Log Message:
Removed file offset caching from mail_cache_foreach(). It didn't work
correctly when cache file was just compressed, and caused "cache file
corrupted" errors.



Index: mail-cache-lookup.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-cache-lookup.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- mail-cache-lookup.c	15 Dec 2006 18:10:54 -0000	1.37
+++ mail-cache-lookup.c	14 Jan 2007 03:17:07 -0000	1.38
@@ -191,16 +191,9 @@
         if (MAIL_CACHE_IS_UNUSABLE(view->cache))
 		return 0;
 
-	if (view->cached_offset_seq == seq)
-		offset = view->cached_offset;
-	else {
-		if ((ret = mail_cache_lookup_offset(view->cache, view->view,
-						    seq, &offset)) <= 0)
-			return ret;
-
-		view->cached_offset_seq = seq;
-		view->cached_offset = offset;
-	}
+	if ((ret = mail_cache_lookup_offset(view->cache, view->view,
+					    seq, &offset)) <= 0)
+		return ret;
 
 	ret = 1;
 	array_clear(&view->tmp_offsets);

Index: mail-cache-private.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-cache-private.h,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- mail-cache-private.h	20 Dec 2006 06:20:25 -0000	1.37
+++ mail-cache-private.h	14 Jan 2007 03:17:07 -0000	1.38
@@ -169,7 +169,6 @@
 	buffer_t *cached_exists_buf;
 	uint8_t cached_exists_value;
 	uint32_t cached_exists_seq;
-	uint32_t cached_offset, cached_offset_seq;
 };
 
 typedef int mail_cache_foreach_callback_t(struct mail_cache_view *view,



More information about the dovecot-cvs mailing list