[dovecot-cvs] dovecot/src/lib-index mail-cache-transaction.c, 1.53, 1.54

tss at dovecot.org tss at dovecot.org
Sun Oct 15 16:11:37 UTC 2006


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

Modified Files:
	mail-cache-transaction.c 
Log Message:
Fix to delayed cache file opening, cached data might have been lost.



Index: mail-cache-transaction.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-cache-transaction.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -d -r1.53 -r1.54
--- mail-cache-transaction.c	10 Sep 2006 12:48:18 -0000	1.53
+++ mail-cache-transaction.c	15 Oct 2006 15:11:34 -0000	1.54
@@ -59,9 +59,6 @@
 	ctx->trans = t;
 	i_array_init(&ctx->reservations, 32);
 
-	if (!MAIL_CACHE_IS_UNUSABLE(ctx->cache))
-		ctx->cache_file_seq = ctx->cache->hdr->file_seq;
-
 	i_assert(view->transaction == NULL);
 	view->transaction = ctx;
 	view->trans_view = mail_index_transaction_open_updated_view(t);
@@ -106,6 +103,13 @@
 {
 	int ret;
 
+	if (ctx->cache_file_seq == 0) {
+		if (!ctx->cache->opened)
+			(void)mail_cache_open_and_verify(ctx->cache);
+		if (!MAIL_CACHE_IS_UNUSABLE(ctx->cache))
+			ctx->cache_file_seq = ctx->cache->hdr->file_seq;
+	}
+
 	if ((ret = mail_cache_lock(ctx->cache)) <= 0)
 		return ret;
 



More information about the dovecot-cvs mailing list