From 8f22f0ab6e6e531a3e9c43872aaef29da4762f1f Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Fri, 24 Sep 2021 18:59:21 +0300 Subject: [PATCH] global: Call o_stream_copy_error_from_parent() only on errors --- src/lib-http/http-transfer-chunked.c | 3 ++- src/lib-mail/ostream-dot.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) 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; } -- 2.47.3