2

I'm having a problem using Curb (ruby curl bindings) for FTP downloads.

It looks like curb doesn't fall back to simple passive mode when extended passive mode fails. Extract from the log follows:

< 250 Directory changed to /outgoing/productcatalog/35591
> EPSV
* Connect data stream passively
< 229 Entering Passive Mode (|||40938|)
*   Trying 216.34.207.42... * Connecting to 216.34.207.42 (216.34.207.42) port 40938
* Connection failed
* Expire cleared
* Closing connection #0

Then in throws Curl::Err::ConnectionFailedError: couldn't connect to server

However, if I use curl in the command line, I get

< 250 Directory changed to /outgoing/productcatalog/35591
> EPSV
* Connect data stream passively
< 229 Entering Passive Mode (|||43267|)
*   Trying 216.34.207.42... Connection refused
* couldn't connect to host
* got positive EPSV response, but can't connect. Disabling EPSV
> PASV
< 227 Entering Passive Mode (216,34,207,42,169,4)
*   Trying 216.34.207.42... connected

The solution would be to disable epsv altogether but it seems impossible with Curb, there's no such option. What can be done in this situation?

Evgeny Shadchnev
  • 7,320
  • 4
  • 27
  • 30
  • Digg this question, I come across this shit too- I can use --disable-epsv in curl but seems no way to setup in CURB? in C API it shows CURLOPT_FTP_USE_EPSV is an option, but I don't see this available in curb – William Yeung Oct 24 '10 at 15:32
  • Eventually I ended up calling normal curl using backticks. – Evgeny Shadchnev Oct 25 '10 at 07:33

1 Answers1

0

The libcurl option to disable EPSV is a simple boolean option and curb should already support lots of other similar options. Adding support for this should be fairly trivial.

Daniel Stenberg
  • 54,736
  • 17
  • 146
  • 222