]> git.kaiwu.me - njs.git/commit
Zlib: set the inflate dictionary when requested master
authorDmitry Volyntsev <xeioex@nginx.com>
Tue, 1 Dec 2026 00:13:50 +0000 (16:13 -0800)
committerDmitry Volyntsev <xeioexception@gmail.com>
Tue, 1 Dec 2026 01:29:33 +0000 (17:29 -0800)
commitce9b399b4117e6cf3281da8e2164b16e0fb8ca06
treec9de0c5d99e0a5b609868588f7d912ae6bc1ccd0
parent196637f3c88f543554803fb673c61b1b45e4bfbf
Zlib: set the inflate dictionary when requested

Since e503f572 in njs and bb3dcf21 in QuickJS, inflateSync() has
tried to set a supplied dictionary before reading the zlib header.
Zlib rejects this for wrapped streams, even if no dictionary is
needed.

For wrapped streams, wait for Z_NEED_DICT before setting the
dictionary. Raw inflate still needs the dictionary up front.
external/njs_zlib_module.c
external/qjs_zlib_module.c
test/zlib.t.mjs