curl-library
Re: Couple cuestions about CURLOPT_WRITEFUNCTION callback
Date: Tue, 14 Feb 2017 15:09:12 +0100
Many thanks for your comments Daniel. I'm now going to perform some testing.
Saludos
David Requena / Gmail
Original Message
From: Daniel Stenberg
Sent: martes, 14 de febrero de 2017 00:28
To: libcurl development
Reply To: libcurl development
Subject: Re: Couple cuestions about CURLOPT_WRITEFUNCTION callback
On Mon, 13 Feb 2017, David Requena wrote:
>> "as soon as possible"
>
> There's exactly one absolute interpretation for ASAP in this context: as
> soon as 1 byte is received. It's absolutely impossible relaying data before
> having it. Any other interpretation would require qualification as to how
> much data, time or whatever other factors involved.
Right, but I don't think we can qualify that much in any meaningful way in the
docs. There are simply too many variables involved.
libcurl reads data from the socket, then sends it to the application.
> - Client sends some http request
> - Server sends response headers: content-type text/eventstream, etc
> - Server does not close the connection and starts sending small, say 30
> bytes a piece, text items every 1 or 2 seconds.
> - The client is supposed to act on those events as they are received.
>
> Now, if libcurl is willing to fillup a 16KB data buffer before invoking
> CURLOPT_WRITEFUNCTION
To me, that would be a very weird defintion of "as soon as possible".
If the server sends 30 bytes chunks, chances are your application will get
those 30 bytes in one or maybe two callbacks.
-- / daniel.haxx.se ------------------------------------------------------------------- Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library Etiquette: https://curl.haxx.se/mail/etiquette.html ------------------------------------------------------------------- Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library Etiquette: https://curl.haxx.se/mail/etiquette.htmlReceived on 2017-02-14