]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: istream-chain didn't update its max_buffer_size
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 1 Jun 2016 15:03:58 +0000 (18:03 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 1 Jun 2016 15:03:58 +0000 (18:03 +0300)
I had this code at some point earlier, but looks like it got lost from the
final commit.

src/lib/istream-chain.c

index ddf0f566c82db5978478b43982eeee0b96bf337d..6880f8d00e2154521b429d364059ae223ae5a32b 100644 (file)
@@ -51,6 +51,11 @@ i_stream_chain_append_internal(struct istream_chain *chain,
                if (cstream->have_explicit_max_buffer_size) {
                        i_stream_set_max_buffer_size(stream,
                                chain->stream->istream.max_buffer_size);
+               } else {
+                       size_t max_size = i_stream_get_max_buffer_size(stream);
+
+                       if (cstream->istream.max_buffer_size < max_size)
+                               cstream->istream.max_buffer_size = max_size;
                }
        }
        DLLIST2_APPEND(&chain->head, &chain->tail, link);