cURL / Mailing Lists / curl-library / Single Mail

curl-library

cURL multi interface question.

From: Anton Rakovchuk <arakovchuk_at_yahoo.com>
Date: Wed, 25 Jan 2006 19:13:59 -0800 (PST)

Hi,

I am trying to use curl library to write the
application which downloads multiple files
simultaneously. The files located on the different
servers and download time may vary significantly. Now
the question: How do I know that specific file has
been downloaded completely?
The write callback function doesn’t receive any
information whether it is the last time it’s been
called or not, so it is impossible to say if the given
download has finished or not. From the other hand,
Curl_multi_perform function returns the total number
of active handles, which can be used to tell whether
all downloads have been completed or not what doesn’t
work for me (as I said download times may vary).
Right now, I can think of only one workaround which is
to create a separate multi handle for each download,
then calling curl_multi_perform will tell me whether
given download has finished or not. Can someone
suggest a better solutions? Because this one looks
like completely against the multi interface idea.

Thanks in advance,
Anton
Received on 2006-01-26