Mercurial > dovecot > core-2.2
changeset 15668:583ea6b63c5d
dsync: Added a quick way to debug unexpected changes.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Mon, 21 Jan 2013 19:43:39 +0200 |
parents | 1b18ff11effc |
children | be5ce6c06b08 |
files | src/doveadm/dsync/dsync-mailbox-import.c |
diffstat | 1 files changed, 9 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/doveadm/dsync/dsync-mailbox-import.c Mon Jan 21 19:41:24 2013 +0200 +++ b/src/doveadm/dsync/dsync-mailbox-import.c Mon Jan 21 19:43:39 2013 +0200 @@ -33,6 +33,10 @@ unsigned int copy_failed:1; }; +/* for quickly testing that two-way sync doesn't actually do any unexpected + modifications. */ +#define IMPORTER_DEBUG_CHANGE(importer) /*i_assert(!importer->master_brain)*/ + HASH_TABLE_DEFINE_TYPE(guid_new_mail, const char *, struct importer_new_mail *); HASH_TABLE_DEFINE_TYPE(uid_new_mail, void *, struct importer_new_mail *); @@ -279,6 +283,7 @@ struct dsync_mail_request *request; if (importer->want_mail_requests && !newmail->uid_in_local) { + IMPORTER_DEBUG_CHANGE(importer); request = array_append_space(&importer->mail_requests); request->guid = newmail->guid; request->uid = newmail->uid; @@ -1108,6 +1113,8 @@ { struct mail_save_context *save_ctx; + IMPORTER_DEBUG_CHANGE(importer); + if (!mail_set_uid(importer->mail, old_uid)) return; @@ -1132,6 +1139,7 @@ if (newmail->skip) { /* already assigned */ if (newmail->uid_in_local) { + IMPORTER_DEBUG_CHANGE(importer); if (mail_set_uid(importer->mail, newmail->uid)) mail_expunge(importer->mail); } @@ -1483,6 +1491,7 @@ if (highest_wanted_uid < saved_uid) highest_wanted_uid = saved_uid; } else { + IMPORTER_DEBUG_CHANGE(importer); if (lowest_unwanted_uid > saved_uid) lowest_unwanted_uid = saved_uid; }