cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Does Libcurl support downloading payload in chunks to increase success rate?

From: Md Kashif <mail_kashif_at_yahoo.co.in>
Date: Fri, 28 Feb 2014 00:19:49 +0800 (SGT)

Hi Yehezkel,

How would application know if download of a chunk was successful or not. Is checking for the return value of curl_easy_perform() for each chunk enough?

Also, for resuming interrupted downloads which option would be the best CURLOPT_RESUME_FROM or CURLOPT_RANGE or is there any other option to do this?

Thanks,
-kashif

On Thursday, 27 February 2014 5:37 PM, Yehezkel Horowitz <horowity_at_checkpoint.com> wrote:

>Does libcurl download the whole payload as single chunk or does it divide the payload into smaller chunks. For example some download managers divide the whole payload into small chunks and download each chunk separately. If download of any chunk fails in between then only that chunk needs to be downloaded again and not the whole payload.

CURLOPT_RANGE is your friend.
http://curl.haxx.se/libcurl/c/curl_easy_setopt.html#CURLOPTRANGE

But take into consideration that your application will need to manage the whole download (understand which parts downloaded successfully and which failed).

HTH
Yehezkel Horowitz

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2014-02-27