curl-library
Re: How to avoid multiple CWD for each file download
From: Daniel Stenberg <daniel_at_haxx.se>
Date: Wed, 19 Jun 2013 20:17:06 +0200 (CEST)
Date: Wed, 19 Jun 2013 20:17:06 +0200 (CEST)
On Wed, 19 Jun 2013, Anders Havn wrote:
> I'm downloading multiple files in a directory. The code run for each file
> looks like this:
...
> The log looks like this for each file. This means that the command CWD is
> done three times for each file. This is properly not good for performace,
> so how do I avoid this?
Apart from Jeff's suggestion, don't close and re-create the easy handle all
the time. Re-use it instead and you'll also gain a lot of performance!
> Another problem is that after downloading about 50 files then it fails with
> an error:
> 2013-06-18 21:08:23> response reading failed 2013-06-18 21:08:23> Error
That's what libcurl will say when it failed receiving data mid server
response.
-- / daniel.haxx.se ------------------------------------------------------------------- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.htmlReceived on 2013-06-19