[dovecot-cvs] dovecot/src/lib-index mail-index-transaction.c, 1.21, 1.22

cras at dovecot.org cras at dovecot.org
Sat Sep 11 19:19:01 EEST 2004


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

Modified Files:
	mail-index-transaction.c 
Log Message:
More "cache file reopened" fixes



Index: mail-index-transaction.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-index/mail-index-transaction.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -d -r1.21 -r1.22
--- mail-index-transaction.c	5 Sep 2004 17:53:45 -0000	1.21
+++ mail-index-transaction.c	11 Sep 2004 16:18:59 -0000	1.22
@@ -595,7 +595,7 @@
 {
 	struct mail_index_record *rec;
 
-	if (file_seq > t->last_cache_file_seq) {
+	if (file_seq != t->last_cache_file_seq) {
 		mail_index_transaction_reset_cache_updates(t);
                 t->last_cache_file_seq = file_seq;
 	}
@@ -622,6 +622,14 @@
 	if (t->cache_updates == NULL)
 		return FALSE;
 
+	if (MAIL_CACHE_IS_UNUSABLE(t->view->index->cache) ||
+	    t->view->index->cache->hdr->file_seq != t->last_cache_file_seq) {
+		/* cache file was recreated, our offsets don't work anymore */
+		mail_index_transaction_reset_cache_updates(t);
+		t->last_cache_file_seq = 0;
+		return FALSE;
+	}
+
 	if (!mail_index_seq_buffer_lookup(t->cache_updates, seq,
 					  sizeof(*offset_r), &pos))
 		return FALSE;



More information about the dovecot-cvs mailing list