mirror of
https://github.com/curl/curl.git
synced 2026-07-22 23:07:16 +03: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
1 changed files with 6 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue