cURL / Mailing Lists / curl-library / Single Mail

curl-library

GZIP encoding error - invalid code lengths set

From: Dobromir Velev <diadomraz_at_gmail.com>
Date: Thu, 13 Aug 2009 15:41:57 +0300

Hi,
I'm currently investigating an issue with gzip encoded data with invalid
ISIZE . It looks like some of the HTTP servers will randomly set the last
four bytes of the response to 0xFFFFFFFF, instead of the uncompressed content
size.
I was wondering if there is a way to make curl and/or zlib to silently ignore
this error since the content is downloaded and decompressed correctly. I can
modify content_encoding.c to return all available data and exit when a data
error is detected and there is no more data to decode, but I'm not sure what
will happen if more data is received at a later stage.

Attached are two trace files which were generated a minute apart from each
other with the same request. The one is OK and the other fails with

Error while processing content unencoding: invalid code lengths set

#src/curl -V
curl 7.19.7-20090813 (i686-pc-linux-gnu) libcurl/7.19.7-20090813
OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5 libssh2/0.18
Protocols: tftp ftp telnet dict http file https ftps scp sftp
Features: IDN Largefile NTLM SSL libz

OS: CentOS release 5.3 (Final)

Regards
Dobromir Velev

Received on 2009-08-13