Unverified Commit d0f1d6c8 authored by Alejandro R. Sedeño's avatar Alejandro R. Sedeño Committed by Daniel Stenberg
Browse files

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
parent 3e0dee06
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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) {