From: Timo Sirainen Date: Sun, 10 Feb 2013 21:11:52 +0000 (+0200) Subject: dsync: Renamed "guid_requests" to "mail_requests" X-Git-Tag: 2.2.beta2~106 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=887a9fbbb2ca6afd53365ba2ccae0ef8728d6948;p=thirdparty%2Fdovecot%2Fcore.git dsync: Renamed "guid_requests" to "mail_requests" The mails aren't necessarily requested by their GUID. --- diff --git a/src/doveadm/dsync/doveadm-dsync.c b/src/doveadm/dsync/doveadm-dsync.c index 17390a54ec..cf35934d83 100644 --- a/src/doveadm/dsync/doveadm-dsync.c +++ b/src/doveadm/dsync/doveadm-dsync.c @@ -420,7 +420,7 @@ cmd_dsync_run_real(struct dsync_cmd_context *ctx, struct mail_user *user) } brain_flags = DSYNC_BRAIN_FLAG_MAILS_HAVE_GUIDS | - DSYNC_BRAIN_FLAG_SEND_GUID_REQUESTS; + DSYNC_BRAIN_FLAG_SEND_MAIL_REQUESTS; if (ctx->sync_all_namespaces) brain_flags |= DSYNC_BRAIN_FLAG_SYNC_ALL_NAMESPACES; diff --git a/src/doveadm/dsync/dsync-brain-mailbox.c b/src/doveadm/dsync/dsync-brain-mailbox.c index 5b18f33cef..5fc86d08f4 100644 --- a/src/doveadm/dsync/dsync-brain-mailbox.c +++ b/src/doveadm/dsync/dsync-brain-mailbox.c @@ -85,12 +85,12 @@ void dsync_brain_sync_init_box_states(struct dsync_brain *brain) if (brain->backup_send) { /* we have an exporter, but no importer. */ brain->box_send_state = DSYNC_BOX_STATE_CHANGES; - brain->box_recv_state = brain->guid_requests ? + brain->box_recv_state = brain->mail_requests ? DSYNC_BOX_STATE_MAIL_REQUESTS : DSYNC_BOX_STATE_RECV_LAST_COMMON; } else if (brain->backup_recv) { /* we have an importer, but no exporter */ - brain->box_send_state = brain->guid_requests ? + brain->box_send_state = brain->mail_requests ? DSYNC_BOX_STATE_MAIL_REQUESTS : DSYNC_BOX_STATE_DONE; brain->box_recv_state = DSYNC_BOX_STATE_CHANGES; @@ -161,7 +161,7 @@ int dsync_brain_sync_mailbox_open(struct dsync_brain *brain) return -1; } - if (!brain->guid_requests) + if (!brain->mail_requests) exporter_flags |= DSYNC_MAILBOX_EXPORTER_FLAG_AUTO_EXPORT_MAILS; if (brain->mails_have_guids) exporter_flags |= DSYNC_MAILBOX_EXPORTER_FLAG_MAILS_HAVE_GUIDS; @@ -201,7 +201,7 @@ void dsync_brain_sync_mailbox_init_remote(struct dsync_brain *brain, last_common_pvt_modseq = 0; } - if (brain->guid_requests) + if (brain->mail_requests) import_flags |= DSYNC_MAILBOX_IMPORT_FLAG_WANT_MAIL_REQUESTS; if (brain->master_brain) import_flags |= DSYNC_MAILBOX_IMPORT_FLAG_MASTER_BRAIN; diff --git a/src/doveadm/dsync/dsync-brain-mails.c b/src/doveadm/dsync/dsync-brain-mails.c index 697962c752..7b10bd7404 100644 --- a/src/doveadm/dsync/dsync-brain-mails.c +++ b/src/doveadm/dsync/dsync-brain-mails.c @@ -69,7 +69,7 @@ static bool dsync_brain_recv_mail_change(struct dsync_brain *brain) return FALSE; if (ret == DSYNC_IBC_RECV_RET_FINISHED) { dsync_mailbox_import_changes_finish(brain->box_importer); - if (brain->guid_requests && brain->box_exporter != NULL) + if (brain->mail_requests && brain->box_exporter != NULL) brain->box_recv_state = DSYNC_BOX_STATE_MAIL_REQUESTS; else brain->box_recv_state = DSYNC_BOX_STATE_MAILS; @@ -88,7 +88,7 @@ static void dsync_brain_send_mail_change(struct dsync_brain *brain) return; } dsync_ibc_send_end_of_list(brain->ibc); - if (brain->guid_requests && brain->box_importer != NULL) + if (brain->mail_requests && brain->box_importer != NULL) brain->box_send_state = DSYNC_BOX_STATE_MAIL_REQUESTS; else brain->box_send_state = DSYNC_BOX_STATE_MAILS; @@ -99,7 +99,7 @@ static bool dsync_brain_recv_mail_request(struct dsync_brain *brain) const struct dsync_mail_request *request; enum dsync_ibc_recv_ret ret; - i_assert(brain->guid_requests); + i_assert(brain->mail_requests); i_assert(brain->box_exporter != NULL); if ((ret = dsync_ibc_recv_mail_request(brain->ibc, &request)) == 0) @@ -118,7 +118,7 @@ static bool dsync_brain_send_mail_request(struct dsync_brain *brain) { const struct dsync_mail_request *request; - i_assert(brain->guid_requests); + i_assert(brain->mail_requests); while ((request = dsync_mailbox_import_next_request(brain->box_importer)) != NULL) { if (dsync_ibc_send_mail_request(brain->ibc, request) == 0) @@ -218,7 +218,7 @@ static bool dsync_brain_send_mail(struct dsync_brain *brain) if (dsync_ibc_send_mail(brain->ibc, mail) == 0) return TRUE; } - if (brain->guid_requests && + if (brain->mail_requests && brain->box_recv_state < DSYNC_BOX_STATE_MAILS) { /* wait for mail requests to finish */ return changed; diff --git a/src/doveadm/dsync/dsync-brain-private.h b/src/doveadm/dsync/dsync-brain-private.h index 17e0480dd5..73e6797d68 100644 --- a/src/doveadm/dsync/dsync-brain-private.h +++ b/src/doveadm/dsync/dsync-brain-private.h @@ -77,7 +77,7 @@ struct dsync_brain { ARRAY_TYPE(dsync_mailbox_state) remote_mailbox_states; unsigned int master_brain:1; - unsigned int guid_requests:1; + unsigned int mail_requests:1; unsigned int mails_have_guids:1; unsigned int backup_send:1; unsigned int backup_recv:1; diff --git a/src/doveadm/dsync/dsync-brain.c b/src/doveadm/dsync/dsync-brain.c index dfd7afc962..678460c39a 100644 --- a/src/doveadm/dsync/dsync-brain.c +++ b/src/doveadm/dsync/dsync-brain.c @@ -70,8 +70,8 @@ dsync_brain_common_init(struct mail_user *user, struct dsync_ibc *ibc) static void dsync_brain_set_flags(struct dsync_brain *brain, enum dsync_brain_flags flags) { - brain->guid_requests = - (flags & DSYNC_BRAIN_FLAG_SEND_GUID_REQUESTS) != 0; + brain->mail_requests = + (flags & DSYNC_BRAIN_FLAG_SEND_MAIL_REQUESTS) != 0; brain->mails_have_guids = (flags & DSYNC_BRAIN_FLAG_MAILS_HAVE_GUIDS) != 0; brain->backup_send = (flags & DSYNC_BRAIN_FLAG_BACKUP_SEND) != 0; diff --git a/src/doveadm/dsync/dsync-brain.h b/src/doveadm/dsync/dsync-brain.h index db8c3c4534..43eb85b181 100644 --- a/src/doveadm/dsync/dsync-brain.h +++ b/src/doveadm/dsync/dsync-brain.h @@ -7,7 +7,7 @@ struct dsync_ibc; enum dsync_brain_flags { DSYNC_BRAIN_FLAG_MAILS_HAVE_GUIDS = 0x01, - DSYNC_BRAIN_FLAG_SEND_GUID_REQUESTS = 0x02, + DSYNC_BRAIN_FLAG_SEND_MAIL_REQUESTS = 0x02, DSYNC_BRAIN_FLAG_BACKUP_SEND = 0x04, DSYNC_BRAIN_FLAG_BACKUP_RECV = 0x08, DSYNC_BRAIN_FLAG_DEBUG = 0x10, diff --git a/src/doveadm/dsync/dsync-ibc-stream.c b/src/doveadm/dsync/dsync-ibc-stream.c index 128d6420bd..54fd96813d 100644 --- a/src/doveadm/dsync/dsync-ibc-stream.c +++ b/src/doveadm/dsync/dsync-ibc-stream.c @@ -61,7 +61,7 @@ static const struct { { .name = "handshake", .chr = 'H', .optional_keys = "sync_ns_prefix sync_box sync_type debug sync_all_namespaces " - "mails_have_guids send_guid_requests backup_send backup_recv" + "mails_have_guids send_mail_requests backup_send backup_recv" }, { .name = "mailbox_state", .chr = 'S', @@ -535,8 +535,8 @@ dsync_ibc_stream_send_handshake(struct dsync_ibc *_ibc, dsync_serializer_encode_add(encoder, "sync_type", sync_type); if ((set->brain_flags & DSYNC_BRAIN_FLAG_MAILS_HAVE_GUIDS) != 0) dsync_serializer_encode_add(encoder, "mails_have_guids", ""); - if ((set->brain_flags & DSYNC_BRAIN_FLAG_SEND_GUID_REQUESTS) != 0) - dsync_serializer_encode_add(encoder, "send_guid_requests", ""); + if ((set->brain_flags & DSYNC_BRAIN_FLAG_SEND_MAIL_REQUESTS) != 0) + dsync_serializer_encode_add(encoder, "send_mail_requests", ""); if ((set->brain_flags & DSYNC_BRAIN_FLAG_BACKUP_SEND) != 0) dsync_serializer_encode_add(encoder, "backup_send", ""); if ((set->brain_flags & DSYNC_BRAIN_FLAG_BACKUP_RECV) != 0) @@ -597,8 +597,8 @@ dsync_ibc_stream_recv_handshake(struct dsync_ibc *_ibc, } if (dsync_deserializer_decode_try(decoder, "mails_have_guids", &value)) set->brain_flags |= DSYNC_BRAIN_FLAG_MAILS_HAVE_GUIDS; - if (dsync_deserializer_decode_try(decoder, "send_guid_requests", &value)) - set->brain_flags |= DSYNC_BRAIN_FLAG_SEND_GUID_REQUESTS; + if (dsync_deserializer_decode_try(decoder, "send_mail_requests", &value)) + set->brain_flags |= DSYNC_BRAIN_FLAG_SEND_MAIL_REQUESTS; if (dsync_deserializer_decode_try(decoder, "backup_send", &value)) set->brain_flags |= DSYNC_BRAIN_FLAG_BACKUP_SEND; if (dsync_deserializer_decode_try(decoder, "backup_recv", &value))