curl-users
Re: RFC2732 support broken
Date: 16 Aug 2001 19:32:20 +0200
Daniel Stenberg <daniel_at_haxx.se> writes:
> Let me show you a little source code comment from lib/ftp.c:
>
> /* no support for IPv6 passive mode yet */
>
> ... and it is actually true. If you some have time over, we would be grateful
> for your help in improving curl in this area!
I've added EPSV support for rpm recently (patch can be found on
rpm-list archives) and I can do this in curl, too but (after looking
into code) I see that almost every network code is
duplicated. Unfortunately this is very, very ugly :-(
Why networking code is done in this way:
#ifdef ENABLE_IPV6
blabla_af_independent;
#else
blabla_af_v4_only;
#endif
?
The best way of doing ipv6 support is doing quite af-independent code.
Take this code:
#ifdef ENABLE_IPV6
res = Curl_getaddrinfo(data, newhost, newport);
if(!res)
#else
he = Curl_gethost(data, newhost, &hostdataptr);
if(!he)
#endif
Instead these #ifdefs leave Curl_getaddrinfo() _only_ and for systems
without getaddrinfo() and friends make simple wrapper (and use
gethostbyxxxx() in it). Look into openssh code. This is very nice
af-independent code.
I can work on this but first I need to know your opinion about
removing v4 only code and leaving af-independent one.
Also IMO RF1639 support can be removed - this rfc belongs to
experimental category while RFC2428 is new standard way of FTP support
over ipv4 and ipv6 and most of ipv6-capable ftp clients/servers
supports only this rfc..
> I guess that allowing IPv4 addresses like that won't hurt much, and is quite
> easily to detect and use. I'll stash that in the TODO file unless you wanna
> have a go at it?
Probably removing
#ifndef ENABLE_IPV6
failf(data, "You haven't enabled IPv6 support");
return CURLE_URL_MALFORMAT;
#else
from lib/url.c will be enough.
> Daniel Stenberg -- curl dude -- http://curl.haxx.se/
-- Arkadiusz Mi¶kiewicz, AM2-6BONE, 1024/3DB19BBD IPv6 ready PLD Linux at http://www.pld.org.pl/ My jsme Borg. Odpor je marný, budete asimilovániReceived on 2001-08-17