]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
dsync: ibc - reference iostreams internally
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 13 Jun 2018 17:06:11 +0000 (20:06 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Thu, 14 Jun 2018 07:43:01 +0000 (10:43 +0300)
This makes it clearer who needs to reference and unreference the streams.

src/doveadm/doveadm-dsync.c
src/doveadm/dsync/dsync-ibc-stream.c

index dbafc5d817a728d4c95726f21fa84f179796fe12..194b3977ac8ab33ffaa57c7fcb1425666c9a14bb 100644 (file)
@@ -521,8 +521,6 @@ cmd_dsync_ibc_stream_init(struct dsync_cmd_context *ctx,
                iostream_rawlog_create_path(ctx->rawlog_path,
                                            &ctx->input, &ctx->output);
        }
-       i_stream_ref(ctx->input);
-       o_stream_ref(ctx->output);
        return dsync_ibc_init_stream(ctx->input, ctx->output,
                                     name, temp_prefix, ctx->io_timeout_secs);
 }
index 129f9d874073804773eeea833275134ed19cd98d..1bb7d30f7f17317d3d078de6e19f52f34bd7ea34 100644 (file)
@@ -2110,6 +2110,8 @@ dsync_ibc_init_stream(struct istream *input, struct ostream *output,
        ibc->ibc.v = dsync_ibc_stream_vfuncs;
        ibc->input = input;
        ibc->output = output;
+       i_stream_ref(ibc->input);
+       o_stream_ref(ibc->output);
        ibc->name = i_strdup(name);
        ibc->temp_path_prefix = i_strdup(temp_path_prefix);
        ibc->timeout_secs = timeout_secs;