Force deflate window bits to 9 fixes #22

This commit is contained in:
Matt Bonneau 2018-01-11 20:51:29 -05:00
parent 61ffa6aa2a
commit e91fcd67c8

View File

@ -376,12 +376,16 @@ class MessageBuffer {
} }
if ($this->deflator === null) { if ($this->deflator === null) {
$bits = (int)$this->getDeflateWindowBits();
if ($bits === 8) {
$bits = 9;
}
$this->deflator = deflate_init( $this->deflator = deflate_init(
ZLIB_ENCODING_RAW, ZLIB_ENCODING_RAW,
[ [
'level' => -1, 'level' => -1,
'memory' => 8, 'memory' => 8,
'window' => $this->getDeflateWindowBits(), 'window' => $bits,
'strategy' => ZLIB_DEFAULT_STRATEGY 'strategy' => ZLIB_DEFAULT_STRATEGY
] ]
); );