Thanks, Daniel!

That clarifies what happens under the hood. And, obviously, curl connects perfectly to majority of servers.


However, I still wonder what to do from the practical point of view...

Right now I have several FTP servers to which any FTP client connects instantly.

libcurl will only connect to them instantly with EPSV disabled. Otherwise it never connects, or it takes really long time.

These servers belong to newspapers and are being used quite extensively.


So... I guess here's the questions I have:

-Do other FTP clients do something that libcurl doesn't?

-Or do they use reversed approach, i.e. try PASV first, then EPSV?

-Is there a way to connect to such servers without disabling EPSV? (But then it can't be used universally).

-Am I missing something?

Thanks,
Leo


On 1/19/11 2:40:37 AM, Daniel Stenberg wrote:
On Wed, 19 Jan 2011, Leo wrote:

By default, libcurl always tries EPSV first, then PASV. However, some FTP sites don't like EPSV and it's impossible to connect unless you disable it.

Such servers are completely broken. libcurl attempts to disable EPSV when it gets a problem with it and retries with PASV instead.

Completely broken servers don't act reasonably so it is hard to come up with reasonable ways to work with them. But of course, if anyone has ideas for improvements then let's discuss them!

So what approach should be used to be able to connect to any site?

libcurl has a sensible default approach IMHO.

Is there a way to query FTP site for preferred command before setting an appropriate libcurl option?

I think the problem isn't always in the particular FTP server but in middle- boxes along the way. The firewall/NAT on the client side and the firewall/load balancer/whatever on the server side. As FTP needs them to be state aware to function perfectly, some old and broken ones will mess up on commands they don't understand. EPSV has only existed in an RFC since 1998 after all! B)


-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html

Reply via email to