cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: DNS round-robin multi-homed FTP server + EPSV = trouble

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Mon, 6 Dec 2004 00:30:08 +0100 (CET)

On Sun, 5 Dec 2004, Richard Atterer wrote:

Thanks for the patch!

> However, I am not 100% sure about one issue: Does
> Curl_printable_address(conn->ip_addr, ...) output a string for the first IP
> returned by the DNS query, or for the actual IP of the control connection?

ip_addr is the actual IP that it connected to, so this patch does it right.

> Regarding the implementation, I find it weird to leave the call to
> Curl_resolv (ftp.c:1601) in the code, because its argument is always an IP
> address in string format. However, after playing around with
> Curl_ip2addr()/Curl_cache_addr() etc for a while, this turned out to be the
> easiest fix - maybe there's a better way?

Nah, libcurl doesn't resolve numercal addresses anyway so it will just detect
that and do the right thing.

I think leaving that is OK, since the following call to Curl_connecthost()
wants a 'struct Curl_dns_entry' pointer as input and the Curl_resolv()
function is conveniently providing one.

I'll commit this now!

-- 
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
       Dedicated custom curl help for hire: http://haxx.se/curl.html
Received on 2004-12-06