History log of /PHP-7.4/ext/bz2/tests/bug75776.phpt (Results 1 – 1 of 1)
Revision Date Author Comments
# 963e50c8 16-Feb-2021 Christoph M. Becker

Fix #75776: Flushing streams with compression filter is broken

First, the `bzip2.compress` filter has the same issue as `zlib.deflate`
so we port the respective fix[1] to ext/bz2.

Fix #75776: Flushing streams with compression filter is broken

First, the `bzip2.compress` filter has the same issue as `zlib.deflate`
so we port the respective fix[1] to ext/bz2.

Second, there is still an issue, if a stream with an attached
compression filter is flushed before it is closed, without any writes
in between. In that case, the compression is never finalized. We fix
this by enforcing a `_php_stream_flush()` with the `closing` flag set
in `_php_stream_free()`, whenever a write filter is attached. This
call is superfluous for most write filters, but does not hurt, even
when it is unnecessary.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=20e75329f2adb11dd231852c061926d0e4080929>

Closes GH-6703.

show more ...