mirror of
https://github.com/curl/curl.git
synced 2024-11-27 05:50:21 +08:00
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
This commit is contained in:
parent
3e0dee065f
commit
d0f1d6c8fa
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user