From: Alejandro R. SedeƱo Date: Fri, 25 May 2018 02:08:04 +0000 (-0400) Subject: content_encoding: handle zlib versions too old for Z_BLOCK X-Git-Tag: curl-7_61_0~126 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d0f1d6c8fa08a55a61186b836024a1b8537badbc;p=curl content_encoding: handle zlib versions too old for Z_BLOCK Fallback on Z_SYNC_FLUSH when Z_BLOCK is not available. Fixes #2606 Closes #2608 --- diff --git a/lib/content_encoding.c b/lib/content_encoding.c index 7c979efcc..b1c5b5012 100644 --- a/lib/content_encoding.c +++ b/lib/content_encoding.c @@ -190,7 +190,13 @@ static CURLcode inflate_stream(struct connectdata *conn, z->next_out = (Bytef *) decomp; z->avail_out = DSIZ; +#ifdef Z_BLOCK + /* Z_BLOCK is only available in zlib ver. >= 1.2.0.5 */ status = inflate(z, Z_BLOCK); +#else + /* fallback for zlib ver. < 1.2.0.5 */ + status = inflate(z, Z_SYNC_FLUSH); +#endif /* Flush output data if some. */ if(z->avail_out != DSIZ) {