]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-compression: istream-decompress - Copy parent stream name
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 24 May 2022 12:52:26 +0000 (15:52 +0300)
committerMarkus Valentin <markus.valentin@open-xchange.com>
Wed, 25 May 2022 12:46:59 +0000 (14:46 +0200)
This is needed, because istream-decompress doesn't actually use the parent
stream as the istream parent.

src/lib-compression/istream-decompress.c

index 27a7f18b6ab6cd9e03c5c3c66418a49422925461..2021a014f5fdd256f60b127d4a6913451757d051 100644 (file)
@@ -249,6 +249,10 @@ i_stream_create_decompress(struct istream *input,
        zstream->istream.istream.blocking = input->blocking;
        zstream->istream.istream.seekable = input->seekable;
 
-       return i_stream_create(&zstream->istream, NULL,
-                              i_stream_get_fd(input), 0);
+       struct istream *ret = i_stream_create(&zstream->istream, NULL,
+                                             i_stream_get_fd(input), 0);
+       /* input isn't used as our parent istream, so need to copy the stream
+          name to preserve it. */
+       i_stream_set_name(ret, i_stream_get_name(input));
+       return ret;
 }