dovecot-2.2: lib-index: Backported MAIL_TRANSACTION_ATTRIBUTE_UP...

dovecot at dovecot.org dovecot at dovecot.org
Fri Apr 5 00:13:33 EEST 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/b2fad9b21e60
changeset: 16191:b2fad9b21e60
user:      Timo Sirainen <tss at iki.fi>
date:      Tue Apr 02 11:32:24 2013 +0300
description:
lib-index: Backported MAIL_TRANSACTION_ATTRIBUTE_UPDATE from v2.2

diffstat:

 src/doveadm/doveadm-dump-log.c         |  14 ++++++++++++++
 src/lib-index/mail-index-modseq.c      |   4 +++-
 src/lib-index/mail-index-sync-update.c |   5 +++++
 src/lib-index/mail-transaction-log.h   |   3 ++-
 4 files changed, 24 insertions(+), 2 deletions(-)

diffs (93 lines):

diff -r 78eb04213251 -r b2fad9b21e60 src/doveadm/doveadm-dump-log.c
--- a/src/doveadm/doveadm-dump-log.c	Sun Mar 31 18:03:50 2013 +0300
+++ b/src/doveadm/doveadm-dump-log.c	Tue Apr 02 11:32:24 2013 +0300
@@ -52,6 +52,7 @@
 	case MAIL_TRANSACTION_FLAG_UPDATE:
 	case MAIL_TRANSACTION_KEYWORD_UPDATE:
 	case MAIL_TRANSACTION_KEYWORD_RESET:
+	case MAIL_TRANSACTION_ATTRIBUTE_UPDATE:
 		/* these changes increase modseq */
 		return TRUE;
 	}
@@ -114,6 +115,9 @@
 	case MAIL_TRANSACTION_BOUNDARY:
 		name = "boundary";
 		break;
+	case MAIL_TRANSACTION_ATTRIBUTE_UPDATE:
+		name = "attribute-update";
+		break;
 	default:
 		name = t_strdup_printf("unknown: %x", type);
 		break;
@@ -413,6 +417,16 @@
 		printf(" - size=%u\n", rec->size);
 		break;
 	}
+	case MAIL_TRANSACTION_ATTRIBUTE_UPDATE: {
+		const char *keys = data;
+		unsigned int i;
+
+		for (i = 0; i < size && keys[i] != '\0'; ) {
+			printf(" - %s\n", keys+i);
+			i += strlen(keys+i) + 1;
+		}
+		break;
+	}
 	default:
 		break;
 	}
diff -r 78eb04213251 -r b2fad9b21e60 src/lib-index/mail-index-modseq.c
--- a/src/lib-index/mail-index-modseq.c	Sun Mar 31 18:03:50 2013 +0300
+++ b/src/lib-index/mail-index-modseq.c	Tue Apr 02 11:32:24 2013 +0300
@@ -375,12 +375,14 @@
 		array_create_from_buffer(&uids, &uid_buf,
 			sizeof(struct mail_transaction_keyword_reset));
 		break;
+	case MAIL_TRANSACTION_ATTRIBUTE_UPDATE:
+		break;
 	default:
 		return;
 	}
 
 	/* update modseqs */
-	count = array_count(&uids);
+	count = array_is_created(&uids) ? array_count(&uids) : 0;
 	for (i = 0; i < count; i++) {
 		rec = array_idx(&uids, i);
 		if (mail_index_lookup_seq_range(ctx->view, rec->seq1, rec->seq2,
diff -r 78eb04213251 -r b2fad9b21e60 src/lib-index/mail-index-sync-update.c
--- a/src/lib-index/mail-index-sync-update.c	Sun Mar 31 18:03:50 2013 +0300
+++ b/src/lib-index/mail-index-sync-update.c	Tue Apr 02 11:32:24 2013 +0300
@@ -523,6 +523,7 @@
 			    const struct mail_transaction_header *hdr,
 			    const void *data)
 {
+	uint64_t modseq;
 	int ret = 0;
 
 	switch (hdr->type & MAIL_TRANSACTION_TYPE_MASK) {
@@ -804,6 +805,10 @@
 		break;
 	case MAIL_TRANSACTION_BOUNDARY:
 		break;
+	case MAIL_TRANSACTION_ATTRIBUTE_UPDATE:
+		modseq = mail_transaction_log_view_get_prev_modseq(ctx->view->log_view);
+		mail_index_modseq_update_highest(ctx->modseq_ctx, modseq);
+		break;
 	default:
 		mail_index_sync_set_corrupted(ctx,
 			"Unknown transaction record type 0x%x",
diff -r 78eb04213251 -r b2fad9b21e60 src/lib-index/mail-transaction-log.h
--- a/src/lib-index/mail-transaction-log.h	Sun Mar 31 18:03:50 2013 +0300
+++ b/src/lib-index/mail-transaction-log.h	Tue Apr 02 11:32:24 2013 +0300
@@ -44,8 +44,9 @@
 	MAIL_TRANSACTION_INDEX_DELETED		= 0x00020000,
 	MAIL_TRANSACTION_INDEX_UNDELETED	= 0x00040000,
 	MAIL_TRANSACTION_BOUNDARY		= 0x00080000,
+	MAIL_TRANSACTION_ATTRIBUTE_UPDATE       = 0x00100000,
 
-	MAIL_TRANSACTION_TYPE_MASK		= 0x000fffff,
+	MAIL_TRANSACTION_TYPE_MASK		= 0x0fffffff,
 
 #define MAIL_TRANSACTION_EXT_MASK \
 	(MAIL_TRANSACTION_EXT_INTRO | MAIL_TRANSACTION_EXT_RESET | \


More information about the dovecot-cvs mailing list