From: Timo Sirainen Date: Tue, 17 Jan 2017 14:23:50 +0000 (+0200) Subject: doveadm: Outgoing dsync TCP connections leaked socket X-Git-Tag: 2.3.0.rc1~2297 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=07af8ef14821e8733c381850fd61d3ccf93ffea2;p=thirdparty%2Fdovecot%2Fcore.git doveadm: Outgoing dsync TCP connections leaked socket If doveadm-server was running with service_count>1, each dsync run leaked a socket. --- diff --git a/src/doveadm/doveadm-dsync.c b/src/doveadm/doveadm-dsync.c index 021ec62e0e..00aeeeb62d 100644 --- a/src/doveadm/doveadm-dsync.c +++ b/src/doveadm/doveadm-dsync.c @@ -498,6 +498,9 @@ cmd_dsync_icb_stream_init(struct dsync_cmd_context *ctx, ctx->input = i_stream_create_fd(ctx->fd_in, (size_t)-1); ctx->output = o_stream_create_fd(ctx->fd_out, (size_t)-1); } else { + i_assert(ctx->fd_in == -1 && ctx->fd_out == -1); + ctx->fd_in = i_stream_get_fd(ctx->input); + ctx->fd_out = o_stream_get_fd(ctx->output); ctx->input_orig_bufsize = i_stream_get_max_buffer_size(ctx->input); ctx->output_orig_bufsize = o_stream_get_max_buffer_size(ctx->output); i_stream_set_max_buffer_size(ctx->input, (size_t)-1);