From: Timo Sirainen Date: Fri, 24 Sep 2021 15:59:21 +0000 (+0300) Subject: global: Call o_stream_copy_error_from_parent() only on errors X-Git-Tag: 2.3.18~294 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8f22f0ab6e6e531a3e9c43872aaef29da4762f1f;p=thirdparty%2Fdovecot%2Fcore.git global: Call o_stream_copy_error_from_parent() only on errors --- diff --git a/src/lib-http/http-transfer-chunked.c b/src/lib-http/http-transfer-chunked.c index 5ad946df4d..0e9099204e 100644 --- a/src/lib-http/http-transfer-chunked.c +++ b/src/lib-http/http-transfer-chunked.c @@ -673,7 +673,8 @@ http_transfer_chunked_ostream_sendv(struct ostream_private *stream, if ((ret = o_stream_flush(stream->parent)) <= 0) { /* error / we still couldn't flush existing data to parent stream. */ - o_stream_copy_error_from_parent(stream); + if (ret < 0) + o_stream_copy_error_from_parent(stream); return ret; } diff --git a/src/lib-mail/ostream-dot.c b/src/lib-mail/ostream-dot.c index 678ffd3711..f5bfa72e20 100644 --- a/src/lib-mail/ostream-dot.c +++ b/src/lib-mail/ostream-dot.c @@ -87,7 +87,8 @@ o_stream_dot_sendv(struct ostream_private *stream, if ((ret=o_stream_flush(stream->parent)) <= 0) { /* error / we still couldn't flush existing data to parent stream. */ - o_stream_copy_error_from_parent(stream); + if (ret < 0) + o_stream_copy_error_from_parent(stream); return ret; }