[dovecot-cvs] dovecot/src/lib-index mail-cache-transaction.c, 1.49, 1.49.2.1

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


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

Modified Files:
      Tag: branch_1_0
	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.49
retrieving revision 1.49.2.1
diff -u -d -r1.49 -r1.49.2.1
--- mail-cache-transaction.c	28 Jan 2006 21:10:41 -0000	1.49
+++ mail-cache-transaction.c	15 Oct 2006 15:11:33 -0000	1.49.2.1
@@ -58,9 +58,6 @@
 	ARRAY_CREATE(&ctx->reservations, default_pool,
 		     struct mail_cache_reservation, 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);
@@ -105,6 +102,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