[dovecot-cvs] dovecot/src/lib-index/maildir maildir-rebuild.c,1.10,1.11 maildir-sync.c,1.35,1.36

cras at procontrol.fi cras at procontrol.fi
Wed Apr 16 19:13:26 EEST 2003


Update of /home/cvs/dovecot/src/lib-index/maildir
In directory danu:/tmp/cvs-serv24654/lib-index/maildir

Modified Files:
	maildir-rebuild.c maildir-sync.c 
Log Message:
Some fixes to opening index.



Index: maildir-rebuild.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-index/maildir/maildir-rebuild.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- maildir-rebuild.c	9 Apr 2003 20:10:01 -0000	1.10
+++ maildir-rebuild.c	16 Apr 2003 15:13:24 -0000	1.11
@@ -4,6 +4,7 @@
 #include "maildir-index.h"
 #include "mail-index-data.h"
 #include "mail-index-util.h"
+#include "mail-tree.h"
 
 #include <unistd.h>
 #include <sys/stat.h>
@@ -33,6 +34,9 @@
 
 	/* reset data file */
 	if (!mail_index_data_reset(index->data))
+		return FALSE;
+
+	if (!mail_tree_reset(index->tree))
 		return FALSE;
 
 	/* read the mails by syncing */

Index: maildir-sync.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-index/maildir/maildir-sync.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- maildir-sync.c	12 Apr 2003 14:59:09 -0000	1.35
+++ maildir-sync.c	16 Apr 2003 15:13:24 -0000	1.36
@@ -484,13 +484,19 @@
 		if (uidlist != NULL &&
 		    uidlist->uid_validity != index->header->uid_validity) {
 			/* uidvalidity changed */
-			if (!index->rebuilding) {
+			if (!index->rebuilding && index->opened) {
 				index_set_corrupted(index,
 					"UIDVALIDITY changed in uidlist");
 				return FALSE;
 			}
 
+			if (!index->rebuilding) {
+				index->set_flags |= MAIL_INDEX_FLAG_REBUILD;
+				return FALSE;
+			}
+
 			index->header->uid_validity = uidlist->uid_validity;
+			i_assert(index->header->next_uid == 1);
 		}
 
 		if (uidlist != NULL &&




More information about the dovecot-cvs mailing list