changeset 2965:89fd53e406dd HEAD

Always register the header-md5, but use separate variable to figure out if it should actually be used.
author Timo Sirainen <tss@iki.fi>
date Tue, 14 Dec 2004 05:03:34 +0200
parents e032167a05ca
children 7ea6705240b3
files src/lib-storage/index/index-storage.h src/lib-storage/index/mbox/mbox-sync-parse.c src/lib-storage/index/mbox/mbox-sync.c
diffstat 3 files changed, 4 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/index-storage.h	Tue Dec 14 04:44:33 2004 +0200
+++ b/src/lib-storage/index/index-storage.h	Tue Dec 14 05:03:34 2004 +0200
@@ -102,6 +102,7 @@
 	unsigned int syncing_commit:1;
 	unsigned int mbox_sync_dirty:1;
 	unsigned int mbox_do_dirty_syncs:1;
+	unsigned int mbox_save_md5:1;
 };
 
 struct index_transaction_context {
--- a/src/lib-storage/index/mbox/mbox-sync-parse.c	Tue Dec 14 04:44:33 2004 +0200
+++ b/src/lib-storage/index/mbox/mbox-sync-parse.c	Tue Dec 14 05:03:34 2004 +0200
@@ -442,11 +442,7 @@
 	}
 
 	/* match by MD5 sum */
-	if (ibox->md5hdr_ext_idx == 0) {
-		ibox->md5hdr_ext_idx =
-			mail_index_ext_register(ibox->index, "header-md5",
-						0, 16, 1);
-	}
+	ibox->mbox_save_md5 = TRUE;
 
 	if (mail_index_lookup_ext(view, seq, ibox->md5hdr_ext_idx, &data) < 0) {
 		mail_storage_set_index_error(ibox);
--- a/src/lib-storage/index/mbox/mbox-sync.c	Tue Dec 14 04:44:33 2004 +0200
+++ b/src/lib-storage/index/mbox/mbox-sync.c	Tue Dec 14 05:03:34 2004 +0200
@@ -349,7 +349,7 @@
 					MODIFY_REPLACE, mbox_flags,
 					mail->keywords);
 
-		if (sync_ctx->ibox->md5hdr_ext_idx != 0) {
+		if (sync_ctx->ibox->mbox_save_md5 != 0) {
 			mail_index_update_ext(sync_ctx->t, sync_ctx->idx_seq,
 					      sync_ctx->ibox->md5hdr_ext_idx,
 					      mail_ctx->hdr_md5_sum, NULL);
@@ -851,12 +851,7 @@
 			/* If we can't use/store X-UID header, use MD5 sum.
 			   Also check for existing MD5 sums when we're actually
 			   able to write X-UIDs. */
-			if (sync_ctx->ibox->md5hdr_ext_idx == 0) {
-				sync_ctx->ibox->md5hdr_ext_idx =
-					mail_index_ext_register(
-						sync_ctx->ibox->index,
-						"header-md5", 0, 16, 1);
-			}
+			sync_ctx->ibox->mbox_save_md5 = TRUE;
 
 			if (mbox_sync_find_index_md5(sync_ctx,
 						     mail_ctx->hdr_md5_sum,