curl / Mailing Lists / curl-library / Single Mail


Re: Issue with WRITE_FUNCTION callback , multi socket interface.

From: Daniel Stenberg via curl-library <>
Date: Tue, 12 Mar 2019 23:31:42 +0100 (CET)

On Tue, 12 Mar 2019, Badari Prasad wrote:

> In continuation with this callback issue I am facing [and as per
>] , if server sends
> Transfer-Encoding: chunked, server will send the size of the chunked data
> and the actual data to the client, libcurl consumes this size of chunked
> data and invokes write callback function when data arrives at the client.
> I was just wondering if libcurl can also pass this size of each chunk and
> then invokes write function callback, this way my application will know size
> of the chunk and can handle the multiple function call backs. Is this some
> how possible with libcurl ?

curl already tells you the size of the data it delivers in every callback
invoke! There's no existing API for curl to inform the application about
chunked-encoded chunk sizes because that's something that curl abstracts away.

You can, if you really want to, ask curl to not decode the transfer encoding
and then you'll get to do the "dechunking" yourself. I wouldn't recommend it
though and I can't see how that would help you...

Received on 2019-03-12