cURL / Mailing Lists / curl-users / Single Mail

curl-users

A possible bug in function inflate_stream (content_encoding.c)?

From: Maruko <maruko.chibi_at_gmail.com>
Date: Sat, 5 Feb 2005 11:17:14 +0800

Hi,

When I test libcurl + HTTP protocol today, I found it failed to
download a 64KB file. In function inflate_stream (content_encoding.c),
 the call to inflate() returns Z_BUF_ERROR.

I noticed that 64KB is just the size of the decompress buffer. When
downloading a 64KB file, the decompress buffer is all used, so
z->avail_out will be 0, in this case, the statement below does not
work correctly:

/* Done with these bytes, exit */
if (status == Z_OK && z->avail_in == 0 && z->avail_out > 0)
                                                               ^ ^ ^ ^
^ ^ ^ ^ ^ ^
I think the condition z->avail_out > 0 should be removed.

Any ideas?

Best regards,
maruko
Received on 2005-02-05