cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Detecting that a retrieval was gzipped

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Mon, 17 May 2004 22:47:31 -0700

On Fri, May 14, 2004 at 11:49:12PM -0700, Jeff Barr wrote:
> Hi,
>
> I am a long-time user and big fan of Curl, fetching 2+ GB per
> day of RSS at www.syndic8.com .
>
> I recently upgraded to Curl 7.11.2 and am currently doing some
> experimentation with CURLOPT_ENCODING.
>
> Is there any way for me to detect that a retrieval was actually
> decompressed by Curl? I tried comparing the value retrieved by
> CURLINFO_SIZE_DOWNLOAD against the value returned from the
> curl_exec call (I am using RETURN_TRANSFER) but they are
> always the same.
>
> Intuitively, I was expecting CURLINFO_SIZE_DOWNLOAD to return
> the physical number of bytes transferred, not the expanded
> size?
>
> Is the actual size available? Ultimately, I would like to be
> able to compute the effective compression ratio for each
> RSS feed.

You should be able to catch the HTTP headers and look for a
Content-Encoding: line.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2004-05-18