[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-sync-private.h, 1.56.2.4, 1.56.2.5 mbox-sync-rewrite.c, 1.62.2.6, 1.62.2.7 mbox-sync.c, 1.181.2.10, 1.181.2.11

tss at dovecot.org tss at dovecot.org
Mon Feb 19 23:28:59 UTC 2007


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

Modified Files:
      Tag: branch_1_0
	mbox-sync-private.h mbox-sync-rewrite.c mbox-sync.c 
Log Message:
Rewriting still wasn't replacing broken X-UID headers correctly always,
causing assert-crashes.



Index: mbox-sync-private.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-sync-private.h,v
retrieving revision 1.56.2.4
retrieving revision 1.56.2.5
diff -u -d -r1.56.2.4 -r1.56.2.5
--- mbox-sync-private.h	16 Feb 2007 19:01:31 -0000	1.56.2.4
+++ mbox-sync-private.h	19 Feb 2007 23:28:57 -0000	1.56.2.5
@@ -121,7 +121,6 @@
 	pool_t saved_keywords_pool;
 
 	uint32_t prev_msg_uid, next_uid, idx_next_uid;
-	uint32_t prev_next_uid, need_space_next_uid;
 	uint32_t seq, idx_seq, need_space_seq;
 	off_t expunged_space, space_diff;
 

Index: mbox-sync-rewrite.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-sync-rewrite.c,v
retrieving revision 1.62.2.6
retrieving revision 1.62.2.7
diff -u -d -r1.62.2.6 -r1.62.2.7
--- mbox-sync-rewrite.c	16 Feb 2007 19:01:31 -0000	1.62.2.6
+++ mbox-sync-rewrite.c	19 Feb 2007 23:28:57 -0000	1.62.2.7
@@ -333,6 +333,10 @@
 	/* mbox_sync_parse_next_mail() checks that UIDs are growing,
 	   so we have to fool it. */
 	sync_ctx->prev_msg_uid = mails[idx].uid == 0 ? 0 : mails[idx].uid-1;
+	/* If we originally thought that the UID was broken, force the
+	   brokeness now also. Otherwise try to make the UID what we wanted
+	   it originally. */
+	sync_ctx->next_uid = mails[idx].uid_broken ? 0 : mail_ctx->mail.uid - 1;
 
 	first_mail_expunge_extra = 1 +
 		sync_ctx->first_mail_crlf_expunged ? 1 : 0;
@@ -359,9 +363,6 @@
 		if (mail_ctx->have_eoh)
 			str_append_c(mail_ctx->header, '\n');
 	}
-
-	if (mail_ctx->mail.uid >= sync_ctx->next_uid)
-		sync_ctx->next_uid = mail_ctx->mail.uid + 1;
 }
 
 static int mbox_sync_read_and_move(struct mbox_sync_context *sync_ctx,
@@ -483,10 +484,8 @@
 	}
 	i_assert(mails[first_nonexpunged_idx].space < 0);
 
-	/* broken UIDs are generated from next_uid */
 	orig_prev_msg_uid = sync_ctx->prev_msg_uid;
 	orig_next_uid = sync_ctx->next_uid;
-	sync_ctx->next_uid = sync_ctx->need_space_next_uid;
 
 	/* start moving backwards. */
 	while (idx > first_nonexpunged_idx) {
@@ -565,7 +564,6 @@
 
 	i_stream_sync(sync_ctx->input);
 	sync_ctx->next_uid = orig_next_uid;
-	sync_ctx->need_space_next_uid = 0;
 	sync_ctx->prev_msg_uid = orig_prev_msg_uid;
 	return ret;
 }

Index: mbox-sync.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-sync.c,v
retrieving revision 1.181.2.10
retrieving revision 1.181.2.11
diff -u -d -r1.181.2.10 -r1.181.2.11
--- mbox-sync.c	6 Feb 2007 19:51:09 -0000	1.181.2.10
+++ mbox-sync.c	19 Feb 2007 23:28:57 -0000	1.181.2.11
@@ -115,7 +115,6 @@
 		istream_raw_mbox_get_start_offset(sync_ctx->input);
 	mail_ctx->mail.offset =
 		istream_raw_mbox_get_header_offset(sync_ctx->input);
-	sync_ctx->prev_next_uid = sync_ctx->next_uid;
 
 	mbox_sync_parse_next_mail(sync_ctx->input, mail_ctx);
 	i_assert(sync_ctx->input->v_offset != mail_ctx->mail.from_offset ||
@@ -761,10 +760,6 @@
 		sync_ctx->need_space_seq = sync_ctx->seq;
 		sync_ctx->space_diff = 0;
 
-		/* remember what the next_uid was before we parsed this mail,
-		   so that rewriting can set it back */
-		sync_ctx->need_space_next_uid = sync_ctx->prev_next_uid;
-
 		if (sync_ctx->expunged_space > 0) {
 			/* create dummy message to describe the expunged data */
 			struct mbox_sync_mail mail;



More information about the dovecot-cvs mailing list