[dovecot-cvs] dovecot/src/lib-index/mbox mbox-rewrite.c,1.66,1.67 mbox-sync-full.c,1.19,1.20

cras at procontrol.fi cras at procontrol.fi
Wed Nov 5 00:26:19 EET 2003


Update of /home/cvs/dovecot/src/lib-index/mbox
In directory danu:/tmp/cvs-serv3517/lib-index/mbox

Modified Files:
	mbox-rewrite.c mbox-sync-full.c 
Log Message:
we didn't sync mbox again after rewriting which left us broken mail offsets.



Index: mbox-rewrite.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-index/mbox/mbox-rewrite.c,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -d -r1.66 -r1.67
--- mbox-rewrite.c	5 Oct 2003 17:54:19 -0000	1.66
+++ mbox-rewrite.c	4 Nov 2003 22:26:16 -0000	1.67
@@ -610,6 +610,9 @@
 		return TRUE;
 	}
 
+	/* kludgy .. but we need to force resyncing */
+	index->mbox_rewritten = TRUE;
+
 	tmp_fd = -1; input = NULL;
 	failed = TRUE; rewrite = FALSE;
 	do {

Index: mbox-sync-full.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-index/mbox/mbox-sync-full.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- mbox-sync-full.c	29 Oct 2003 15:45:41 -0000	1.19
+++ mbox-sync-full.c	4 Nov 2003 22:26:16 -0000	1.20
@@ -329,6 +329,13 @@
 			failed = !mbox_sync_from_stream(index, input);
 		}
 
+		if (index->mbox_rewritten) {
+			/* rewritten, sync again */
+                        index->mbox_rewritten = FALSE;
+			i_stream_seek(input, 0);
+			failed = !mbox_sync_from_stream(index, input);
+		}
+
 		i_stream_unref(input);
 	}
 



More information about the dovecot-cvs mailing list