cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Chunked encoding content in callback writefunction?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 27 May 2003 16:36:24 +0200 (CEST)

On Tue, 27 May 2003, Cyrill Osterwalder wrote:

> I'm using the callback function to receive the content and process it
> myself. It seems that libcurl automatically decodes the chunked encoding
> and does not return the content in the "raw" form. In my program the
> consistency between the received header and the content is crucial. The
> received header still contains "transfer-encoding: chunked" and no content
> length but the received content does not contain the chunked encoding
> anymore.
>
> Is this the intentional behavior of libcurl

It is.

> or am I just doing someting wrong?

Nope.

> Is there a way to get the raw content of a transfer to process it
> afterwards?

No person before has requested this so we haven't made it possible, and I
still can't really see the point of doing it.

> I guess I can force HTTP 1.0 in order to get rid of the chunked encoding
> stuff but that's only a workaround.

That's indeed a work-around, but I wouldn't mind offering some kind of
ability to get the RAW untreated data passed on to the application.

Can't you just hide the "chunked" header info from whatever is expecting the
chunked data? Then you won't need to duplicate the same code that libcurl
already offers. It seems silly to me.

-- 
 Daniel Stenberg -- curl: been grokking URLs since 1998
-------------------------------------------------------
This SF.net email is sponsored by: ObjectStore.
If flattening out C++ or Java code to make your application fit in a
relational database is painful, don't do it! Check out ObjectStore.
Now part of Progress Software. http://www.objectstore.net/sourceforge
Received on 2003-05-27