cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Problems with CURLOPT_PORT in FTP code

From: Dave Halbakken <YetAnotherDev_at_netscape.net>
Date: Tue, 22 Apr 2003 15:03:46 -0700

Ahh, yes. RTFM first! I did not pass a whole IP address, including the
port number, to CURLOPT_FTPPORT. Instead, I just passed the port number.
It worked correctly if I passed '-' as the CURLOPT_FTPPORT value.

> What did you want it to do? Just set the port number for data connection?

Yes, I just want to set the port number for the data channel using
CURLOPT_FTPPORT.

> FTPPORT doesn't support that, but we could easily make it allow a
":[port]"
> in good old style to be appended...

I'd really like to be able to set the port using CURLOPT_FTPPORT.

Thanks, Daniel.

Dave

daniel_at_haxx.se wrote:
> On Tue, 22 Apr 2003, Dave Halbakken wrote:
>
>
>>I was unable to make libcurl act correctly when a port number was set (and,
>>of course, PASV was turned off) on WinXP using VC6 compiler.
>
>
> A port number? You mean in the URL?
>
> Your code excerpt seems to indicate that you used CURLOPT_FTPPORT to set a
> port number, and then I think I've failed to document it in a sensible way.
>
>
>>It looks as if the code was using the port number as an IP address. I
>>modified the code so that it works for me, as shown below.
>
>
> Yes. As the man page says:
>
> Pass a pointer to a zero terminated string as parameter. It will be used to
> get the IP address to use for the ftp PORT instruction. The PORT
> instruction tells the remote server to connect to our specified IP address.
> The string may be a plain IP address, a host name, an network interface
> name (under Unix) or just a '-' letter to let the library use your systems
> default IP address.
>
> What did you want it to do? Just set the port number for data connection?
> FTPPORT doesn't support that, but we could easily make it allow a ":[port]"
> in good old style to be appended...
>

-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2003-04-23