]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: ostream-wrapper - Call output_finished() callback when wrapper stream is finishe...
authorStephan Bosch <stephan.bosch@open-xchange.com>
Wed, 25 Jan 2023 17:39:44 +0000 (18:39 +0100)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Mon, 30 Jan 2023 19:48:46 +0000 (19:48 +0000)
Before, it would only be called when the parent output is also fully flushed,
which is too late.

src/lib/ostream-wrapper.c

index dfd669946fb3cf8481facdd24fabf4c1a65229a0..79d2ccb3c1558289e63cd80b6eb19ee26123249e 100644 (file)
@@ -922,9 +922,9 @@ static int wrapper_ostream_flush(struct ostream_private *stream)
                }
        } while (ret == 0 && stream->ostream.blocking);
 
-       if (ret > 0 && stream->finished) {
+       if (stream->finished && ret >= 0 &&
+           wrapper_ostream_is_empty(wostream)) {
                /* This was an o_stream_finish() call or subsequent flush */
-               i_assert(wrapper_ostream_is_empty(wostream));
                while ((ret = wrapper_ostream_finish(wostream)) == 0) {
                        if (!stream->ostream.blocking) {
                                /* Not yet finished completely */