cURL / Mailing Lists / curl-library / Single Mail

curl-library

content-encoding: gzip

From: David Remahl <david_at_ittpoi.com>
Date: Mon, 12 May 2003 20:29:17 +0200

Hi list! (first poster; searched archives and google for hours but
didn't find anything; sorry if I missed something)

I am making an application that needs to accept gzipped gzipped data.
The server compresses the data if I send Accept-encoding: gzip,
equivalent to the following client app command line:

curl --header 'accept-encoding: gzip' http://localhost/path

The server responds, as expected with something like this:

HTTP/1.1 200 OK
Date: Mon, 12 May 2003 18:07:11 GMT
Content-Type: application/x-whatever
Content-Length: 129
Content-Encoding: gzip

<gzipped data>

 From reading the libcurl source, I find that handling of
Content-Encoding: gzip is currently not implemented
(http_chunks.c:192). Because of this, my problem is to find a good way
to decompress the gzip stream.

I think it must be possible to use zlib for this, but the gzip oriented
functions in zlib are all file oriented. Previously, it was my
understanding that inflate() would handle gzip, since it is basically
the same algorithm as deflate / zip. That doesn't seem to be the case,
since I get a BAD_DATA error from zlib when I ask it to inflate the
gzip content.

I have looked "everywhere" for an implementation of a program that
inflates a gzip stream, but failed. Does anyone have a solution (except
for forking a gzip process and pipe the stream to, which would be
rather wasteful). Is inflate really the solution? In that case, why
isn't gzip implemented in libcurl?

/ Sincerely, David Remahl

-------------------------------------------------------
Enterprise Linux Forum Conference & Expo, June 4-6, 2003, Santa Clara
The only event dedicated to issues related to Linux enterprise solutions
www.enterpriselinuxforum.com
Received on 2003-05-12