cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Problems with CURLOPT_PORT in FTP code

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 22 Apr 2003 23:41:58 +0200 (CEST)

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...

-- 
 Daniel Stenberg -- curl, cURL, Curl, CURL. Groks URLs.
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Received on 2003-04-22