[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-mail.c, 1.18, 1.19

cras at dovecot.org cras at dovecot.org
Sun Dec 5 03:45:56 EET 2004


Update of /var/lib/cvs/dovecot/src/lib-storage/index/mbox
In directory talvi:/tmp/cvs-serv16527/lib-storage/index/mbox

Modified Files:
	mbox-mail.c 
Log Message:
Renamed mail_index_refresh() to mail_index_reopen_if_needed(). Added public
mail_index_refresh() which makes sure index is fully refreshed at the time.
Added mbox code to call it after mbox is locked to avoid using old mbox offsets.



Index: mbox-mail.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-mail.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- mbox-mail.c	10 Oct 2004 17:44:54 -0000	1.18
+++ mbox-mail.c	5 Dec 2004 01:45:54 -0000	1.19
@@ -31,6 +31,13 @@
 		if (mbox_sync(ibox, sync_flags) < 0)
 			return -1;
 
+		/* refresh index file after mbox has been locked to make
+		   sure we get only up-to-date mbox offsets. */
+		if (mail_index_refresh(ibox->index) < 0) {
+			mail_storage_set_index_error(ibox);
+			return -1;
+		}
+
 		i_assert(ibox->mbox_lock_type != F_UNLCK);
 		t->mbox_lock_id = ibox->mbox_lock_id;
 	}



More information about the dovecot-cvs mailing list