[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-sync-rewrite.c, 1.77, 1.78

tss at dovecot.org tss at dovecot.org
Wed Mar 21 23:12:58 EET 2007


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

Modified Files:
	mbox-sync-rewrite.c 
Log Message:
Changed assert to more informative panic message.



Index: mbox-sync-rewrite.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-sync-rewrite.c,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -d -r1.77 -r1.78
--- mbox-sync-rewrite.c	11 Mar 2007 16:26:33 -0000	1.77
+++ mbox-sync-rewrite.c	21 Mar 2007 21:12:56 -0000	1.78
@@ -420,7 +420,14 @@
 	if (mail_ctx->mail.space <= 0) {
 		need_space = str_len(mail_ctx->header) - mail_ctx->mail.space -
 			(mail_ctx->body_offset - mail_ctx->hdr_offset);
-		i_assert(need_space == (uoff_t)-mails[idx].space);
+		if (need_space != (uoff_t)-mails[idx].space) {
+			i_panic("mbox %s: seq=%u uid=%u uid_broken=%d "
+				"originally needed %"PRIuUOFF_T
+				" bytes, now needs %"PRIuSIZE_T" bytes",
+				sync_ctx->mbox->path, seq, mails[idx].uid,
+				mails[idx].uid_broken,
+				(uoff_t)-mails[idx].space, need_space);
+		}
 	}
 
 	if (mails[idx].space == 0) {



More information about the dovecot-cvs mailing list