cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Query on handling chunk transfer encoding

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 22 Sep 2015 08:49:29 +0200 (CEST)

On Tue, 22 Sep 2015, Thiru balaji wrote:

(please don't top-post)

> Thanks for clarification, Still how can I be sure that entire data is send
> from server in chunk transfer mode. Does it mean that curl_multi_perform or
> curl_easy_perform should return with value CURLM_OK.

Yes! You should always check the return code for errors. An incomplete
transfer will signal an error as it is a broken transfer.

> Or can I use curl_easy_getinfo with CURLINFO_RESPONSE_CODE to identify
> whether my download is complete.

The response code is the HTTP code from the server, it does not tell if the
transfer was prematurely cut off or not. The return code will though.

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