cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Write callback with Chunked Encoding

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 19 Sep 2011 22:10:26 +0200 (CEST)

On Mon, 19 Sep 2011, amit paliwal wrote:

> Suppose the Server sends data using "transfer-encoding: chunked", will curl
> call the registered write callack for every chunk that it receives or does
> it call the write callback only when all the chunks are received
> successfully and the response message is over.

libcurl will always send data to the write callback in pieces (it can end up
as only a single piece at times, even if the typical cases means many pieces).

If libcurl receives the data from the server as chunked encoded or not doesn't
change the API promise to the application, it will still deliver data in
pieces as they arrive. libcurl will deliver a full chunk or parts of a chunk
or parts of multiple chunks, depending on network situation and sizes of the
incoming chunks.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2011-09-19