]> granicus.if.org Git - php/commit
Improve ZBLOCK handling with zlib < 1.2.4
authorDaniel Lowrey <rdlowrey@php.net>
Thu, 7 May 2015 14:26:56 +0000 (10:26 -0400)
committerDaniel Lowrey <rdlowrey@php.net>
Thu, 7 May 2015 14:31:41 +0000 (10:31 -0400)
commitc48817297505b5181321047d0a5704e55a6efd6e
tree657f3a369294ac45265e5816665703cf5049e06f
parent3cc59b3fa0d2bbea6f5d19eb38668f7b9c30b449
Improve ZBLOCK handling with zlib < 1.2.4

The original commit for this issue (62b1293) assumed Z_BLOCK was
only defined in < 1.2.4. However, this flush type *is* defined but
is only unavailable for use with deflate().

This new commit correctly checks the ZLIB_VERNUM constant to
determine if Z_BLOCK flush is available for the current deflate()
operation and triggers an appropriate error as needed.

New ZLIB_VERSION and ZLIB_VERNUM constants are also exposed in
userland to allow testing this behavior in environments running
zlib < 1.2.4 (ZLIB_VERNUM check is needed).
ext/zlib/tests/deflate_add_basic.phpt
ext/zlib/tests/deflate_add_block_v123.phpt [new file with mode: 0644]
ext/zlib/tests/inflate_add_basic.phpt
ext/zlib/zlib.c