From: Stephan Bosch Date: Tue, 10 Oct 2017 17:12:52 +0000 (+0200) Subject: doveadm: mail: Removed redundant cur_client_ip field from struct doveadm_mail_cmd_con... X-Git-Tag: 2.3.0.rc1~770 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2ff59d50fe18864f3532004fbbcd98f371a6e22f;p=thirdparty%2Fdovecot%2Fcore.git doveadm: mail: Removed redundant cur_client_ip field from struct doveadm_mail_cmd_context. --- diff --git a/src/doveadm/doveadm-dsync.c b/src/doveadm/doveadm-dsync.c index 7f82e15935..9e9442d6c7 100644 --- a/src/doveadm/doveadm-dsync.c +++ b/src/doveadm/doveadm-dsync.c @@ -573,10 +573,10 @@ cmd_dsync_run(struct doveadm_mail_cmd_context *_ctx, struct mail_user *user) int ret = 0; i_zero(&set); - if (_ctx->cur_client_ip.family != 0) { + if (cctx->remote_ip.family != 0) { /* include the doveadm client's IP address in the ps output */ set.process_title_prefix = t_strdup_printf( - "%s ", net_ip2addr(&_ctx->cur_client_ip)); + "%s ", net_ip2addr(&cctx->remote_ip)); } set.sync_since_timestamp = ctx->sync_since_timestamp; set.sync_until_timestamp = ctx->sync_until_timestamp; @@ -1155,10 +1155,10 @@ cmd_dsync_server_run(struct doveadm_mail_cmd_context *_ctx, i_set_failure_prefix("dsync-server(%s): ", user->username); name = i_stream_get_name(ctx->input); - if (_ctx->cur_client_ip.family != 0) { + if (cctx->remote_ip.family != 0) { /* include the doveadm client's IP address in the ps output */ process_title_prefix = t_strdup_printf( - "%s ", net_ip2addr(&_ctx->cur_client_ip)); + "%s ", net_ip2addr(&cctx->remote_ip)); } } else { /* the log messages go via stderr to the remote dsync, diff --git a/src/doveadm/doveadm-mail.c b/src/doveadm/doveadm-mail.c index 09d7863c4c..5a75e3575b 100644 --- a/src/doveadm/doveadm-mail.c +++ b/src/doveadm/doveadm-mail.c @@ -450,7 +450,6 @@ int doveadm_mail_single_user(struct doveadm_mail_cmd_context *ctx, i_assert(cctx->username != NULL); doveadm_cctx_to_storage_service_input(cctx, &ctx->storage_service_input); - ctx->cur_client_ip = cctx->remote_ip; ctx->cur_username = cctx->username; ctx->storage_service = mail_storage_service_init(master_service, NULL, ctx->service_flags); @@ -521,7 +520,7 @@ doveadm_mail_all_users(struct doveadm_mail_cmd_context *ctx, } if (doveadm_verbose) printf("\n"); - ip = net_ip2addr(&ctx->cur_client_ip); + ip = net_ip2addr(&cctx->remote_ip); if (ip[0] == '\0') i_set_failure_prefix("doveadm: "); else diff --git a/src/doveadm/doveadm-mail.h b/src/doveadm/doveadm-mail.h index ca56733d78..a1ec1ab63d 100644 --- a/src/doveadm/doveadm-mail.h +++ b/src/doveadm/doveadm-mail.h @@ -76,7 +76,6 @@ struct doveadm_mail_cmd_context { struct mail_search_args *search_args; struct istream *users_list_input; - struct ip_addr cur_client_ip; const char *cur_username; struct mail_storage_service_user *cur_service_user; struct mail_user *cur_mail_user;