cURL / Mailing Lists / curl-library / Single Mail

curl-library

[PATCH] Active Mode FTPS Data Port Range

From: <koettermarkus_at_gmx.de>
Date: Sat, 25 Apr 2009 05:19:51 +0200

Daniel Stenberg wrote:
> The TODO mention: http://curl.haxx.se/docs/todo.html#PORT_port_range
>
> The source code: lib/ftp.c:ftp_state_use_port() would be a starting
> point I guess.

I had a look, first idea was 'not possible' due to ipv6.
Then I decided you have to enter ipv6 addresses as [ipv6] if you want to
specify a port(range), and curl has to keep compatibility with current
ipv6 format.

Accepted format for FTPPORT is
(ipv4|ipv6|domain|interface)?(:port(-range)?)?

excluding
ipv6:port(-range) as we never how to interpret it, you have to use
[ipv6]:port(-range)
for this case
nevertheless
[ipv6] is accepted too.

errors like
:4711-1024
are corrected ( 0 is choosen )

Patch is attached, tested with ipv4/6 for domains, addresses, interfaces.

As I did not get the idea of maintaining seperate dualstack and ipv4
code for it, I removed the ipv4 only code, and ifdef'd the dualstack
part to be ipv4 only compatible.

Markus

Received on 2009-04-25