cURL / Mailing Lists / curl-library / Single Mail


Re: Bypassing libcurl's handling of content-encoding and

From: Daniel Stenberg <>
Date: Wed, 7 Feb 2007 21:56:33 +0100 (CET)

On Wed, 7 Feb 2007, Shmulik Regev wrote:

> Can it be that the results you saw were actually generated from a server
> response that didn't respond with chunked encoding, just like in the example
> I posted?

I'm afraid not. See my versions of dump1 and dump2 attached here.

(produced with "curl --raw --trace dump2 -o dump1")

And I'm using the very latest CVS of course.

> Attached are two dump files (dump1 is the output, dump2 is the trace) that
> actually seem ok (or am I missing something)? I tested the patch you've
> forwarded me and it behaved very nicely with other sites that return their
> data chunked.

Yeps, your version of 'dump1' clearly includes the final trailing chunk while
my version doesn't!

The difference is that in your case you got the whole response in one single
recv() while I in my end seems to get the response body split into two
separate recv() calls and the code doesn't deal with the fact that the first
read gets the data and the second only gets some non-data chunked stuff.

This is because the skipping of the chunked is done in the data part of the
chunked state machine and in my case the final part has no data...

  Commercial curl and libcurl Technical Support:

  • TEXT/PLAIN attachment: dump1
  • TEXT/PLAIN attachment: dump2
Received on 2007-02-07