curl / Mailing Lists / curl-library / Single Mail


Re: Issue with WRITE_FUNCTION callback , multi socket interface.

From: Badari Prasad via curl-library <>
Date: Tue, 12 Mar 2019 20:28:37 +0530

Hi Daniel,
      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 ?


On Tue, Mar 5, 2019 at 9:28 PM Badari Prasad <> wrote:

> Thank you for response.
> On Mon 4 Mar, 2019, 12:37 Daniel Stenberg < wrote:
>> On Mon, 4 Mar 2019, Badari Prasad via curl-library wrote:
>> > Does libcurl provide any event to application like START_OF_READ when
>> > response is ready and END_OF_READ kind of event which I can make use of
>> for
>> > an http connection ? or any other better solution to this kind of issue
>> > where multiple responses for a single http request is received by
>> client.
>> No.
>> The response that curl gets is TCP. TCP is just a stream of bytes and
>> curl
>> reads bytes whenever there are any available on the network to read.
>> There's
>> no way for curl to make any other distinction of what is being delivered.
>> If what comes over the TCP is multiple messages as you say, then you need
>> to
>> parse the contents or otherwise send markers in that content to make your
>> app
>> able to do the necessary separation.
>> Also remember that due to routing, package retransmits etc, what looked
>> like
>> "gaps" between TCP segments from one end might not at all by any gaps in
>> the
>> other end, and data that is sent back to back might end up arriving with
>> time
>> between the packages.
>> --
>> /

Received on 2019-03-12