Re: Issue with WRITE_FUNCTION callback , multi socket interface.
Date: Tue, 12 Mar 2019 20:28:37 +0530
In continuation with this callback issue I am facing [and as per
https://curl.haxx.se/mail/lib-2011-09/0232.html] , 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 <badari.hp_at_gmail.com> wrote:
> Thank you for response.
> On Mon 4 Mar, 2019, 12:37 Daniel Stenberg <daniel_at_haxx.se 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
>> > an http connection ? or any other better solution to this kind of issue
>> > where multiple responses for a single http request is received by
>> The response that curl gets is TCP. TCP is just a stream of bytes and
>> reads bytes whenever there are any available on the network to read.
>> 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
>> parse the contents or otherwise send markers in that content to make your
>> able to do the necessary separation.
>> Also remember that due to routing, package retransmits etc, what looked
>> "gaps" between TCP segments from one end might not at all by any gaps in
>> other end, and data that is sent back to back might end up arriving with
>> between the packages.
>> / daniel.haxx.se
Received on 2019-03-12