cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Problem with a particular ftp-server

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 19 Mar 2002 09:52:18 +0100 (MET)

On Tue, 19 Mar 2002, Guido Neitzer wrote:

> > It clearly looks like it disconnected just after the PASV response,
>
> No, it waits, and waits, and waits ... and then disconnects.

Aha!

> > of course shouldn't. I check the code right now and I fail to see how
> > this can happen without any error message getting output! ;-/
>
> It get the following result code from libcurl:
>
> 2002-03-19 09:45:20.703 MirrorX[2130] curl result: CURLE_COULDNT_CONNECT
>
> Okay, I will try to compile and include the latest version of libcurl

It looks as if the server doesn't accept the connection to the port it claims
to have opened for "us".

You can make a little test:

From the same machine you run this from, when the PASV command has been
issued and libcurl is waiting, telnet to the IP and the port as the
227-reply indicates.

To figure out where to connect, check the 227 string and do this:

        227 Entering Passive Mode (a1,a2,a3,a4,p1,p2)

port = p1*256 + p2

$ telnet a1.a2.a3.a4 port

... this will most likely also "hang" as the server doesn't seem to allow the
second connect.

Once we've established this fact, you can of course use CURLOPT_FTPPORT to
have libcurl use PORT instead of PASV. It might be what you want/need here.

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2002-03-19