[dovecot-cvs] dovecot/src/lib-storage/index index-mail.c, 1.37, 1.38 index-storage.h, 1.70, 1.71

cras at procontrol.fi cras at procontrol.fi
Sun Jul 4 14:50:51 EEST 2004


Update of /home/cvs/dovecot/src/lib-storage/index
In directory talvi:/tmp/cvs-serv22881/lib-storage/index

Modified Files:
	index-mail.c index-storage.h 
Log Message:
Cache file compression works now and compressed cache file is reopened.
Several other cleanups related to opening - cache file isn't created
immediately anymore.



Index: index-mail.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/index-mail.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- index-mail.c	28 Jun 2004 17:35:27 -0000	1.37
+++ index-mail.c	4 Jul 2004 11:50:49 -0000	1.38
@@ -128,10 +128,17 @@
 	if (mail->trans->cache_trans != NULL)
 		return TRUE;
 
+	if (mail->trans->cache_trans_failed) {
+		/* don't try more than once */
+		return FALSE;
+	}
+
 	if (mail_cache_transaction_begin(mail->trans->cache_view, TRUE,
 					 mail->trans->trans,
-					 &mail->trans->cache_trans) <= 0)
+					 &mail->trans->cache_trans) <= 0) {
+                mail->trans->cache_trans_failed = TRUE;
 		return FALSE;
+	}
 
 	mail->data.cached_fields =
 		mail_cache_get_fields(mail->trans->cache_view, mail->data.seq);

Index: index-storage.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/index-storage.h,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- index-storage.h	24 Jun 2004 13:47:35 -0000	1.70
+++ index-storage.h	4 Jul 2004 11:50:49 -0000	1.71
@@ -118,6 +118,7 @@
 	struct mail_cache_transaction_ctx *cache_trans;
 
 	struct index_mail fetch_mail; /* for index_storage_fetch() */
+	unsigned int cache_trans_failed:1;
 };
 
 int mail_storage_set_index_error(struct index_mailbox *ibox);



More information about the dovecot-cvs mailing list