cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Re: How to avoid multiple CWD for each file download

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 20 Jun 2013 20:18:48 +0200 (CEST)

On Thu, 20 Jun 2013, Anders Havn wrote:

> Can any of the commands CURLFTPMETHOD_NOCWD and CURLFTPMETHOD_SINGLECWD
> cause the code to not work on some ftp servers?

Yes.

> I tried using CURLFTPMETHOD_NOCWD on my own ftp server and it worked fine as
> long as the url didn't contain a folder path, ex:
> "ftp://myftpserver.org/FirstFolder/". With this url it couldn't list some
> subfolders in FirstFolder. Quite weird.

Well, without more details I can't tell who's to blame or why.

> I call curl_easy_reset because I have some other curl_easy_setopt calls that
> isn't always used. And then I call the following code when disconnecting
> from the server:
>
> curl_easy_cleanup(curl);

If you close the handle then you don't reuse it! Don't call
curl_easy_cleanup() + curl_easy_init() between the transfers but instead just
keep using the same handle. You'll see a significant performance boost.

> curl_global_cleanup();

You should only call the curl_global_* functions once during your program's
entire life-time.

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2013-06-20