]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: istream-chain - Optimize snapshot handling
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 4 Oct 2021 21:55:57 +0000 (00:55 +0300)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Fri, 8 Oct 2021 13:14:15 +0000 (13:14 +0000)
src/lib/istream-chain.c

index 6ee65a14aa49b3774c210592ec7d0678b66cc12a..a69122d35875d8fb96d19f37c3e8861ce904b973 100644 (file)
@@ -228,12 +228,9 @@ static ssize_t i_stream_chain_read(struct istream_private *stream)
        if (data_size > cur_data_pos)
                ret = 0;
        else {
-               /* need to read more - NOTE: Can't use i_stream_read_memarea()
-                  here, because our stream->buffer may point to the parent
-                  istream. This could be avoided if we implemented
-                  snapshotting ourself. */
+               /* need to read more */
                i_assert(cur_data_pos == data_size);
-               ret = i_stream_read(link->stream);
+               ret = i_stream_read_memarea(link->stream);
                if (ret == -2 || ret == 0)
                        return ret;