cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: FW: HTTP GET using easycurl - HTTP chunks in HTTP response.

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Wed, 13 Dec 2006 14:29:48 -0800

On Wed, Dec 13, 2006 at 02:47:50PM -0600, Rangoli Mathur wrote:
> If I have defined a function: write_data and I have used
> Curl_easy_setopt(curlHandle, CURLOPT_WRITE_FUNCTION, write_data).
>
> For HTTP1.1 chunked transfer encoding, Does the write_data function get
> called once for every http chunk there is?

Not necessarily. You shouldn't rely on that behaviour, even it it appears
to be the case.

> If so, for the body, can I safely assume that every write would begin
> with the number of bytes to read in hex, followed by those many bytes?

libcurl should be taking care of un-chunking the data for you. If not,
then there is likely a problem with the web server, or, less likely, libcurl
itself. Send us a debug log of the transaction where you're seeing this
if you'd like more details.

>>> Dan

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