cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: segmented parallel ftp downloads

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Mon, 19 Nov 2001 11:41:32 +0100 (MET)

On Sat, 17 Nov 2001, Puneet Pawaia wrote:

> I would like to use libcurl to download a file from the ftp server by
> segmenting it and downloading all segments in parallel.
>
> My understanding is that I need to use CURLOPT_RANGE to set the range for
> each download. Once that is done, I start downloading all segments and
> when all segments are downloaded, then to append them to the single file
> in that order.
>
> My problem is that to get the ranges, I need the file size whereas the
> download size is only available when the download starts.
>
> I must be missing something.

I don't think you're missing anything. How would you like it to work? I'm
open to suggestions/improvements in how this is made.

You could try first getting the file with NOBODY set to 1, as that'll return
only a set of "headers" for the given file, and then get it it using as many
separate connections you want.

You are aware that you'll use two TCP connections for each parallell
transfer, right?

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2001-11-19