cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: parallelized download of many files too slow

From: Yehezkel Horowitz <horowity_at_checkpoint.com>
Date: Sun, 23 Sep 2012 16:15:19 +0200

I think these lines are the problem with your approach
> while (still_running){
> curl_multi_perform(multi_handle, &still_running);
> usleep(100000);
> }

You call curl to progress whenever you want (why you just sleep 100K?!), instead of when curl needs to be called.

For this your code should be event driven (with the socket and time functions of the multi API).

See more about the multi API in http://curl.haxx.se/libcurl/c/libcurl-multi.html
And also an example here: http://curl.haxx.se/libcurl/c/multi-app.html

HTH

Yehezkel

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