cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: multihomed connections

From: Daniel Stenberg <daniel-curl_at_haxx.se>
Date: Thu, 10 Jun 2004 13:04:39 +0200 (CEST)

On Wed, 9 Jun 2004, Gisle Vanem wrote:

> > * trying 82.73.204.1... * Connection refused
> > * trying 217.121.93.1... * Connection refused
>
> Did that,

I like it. Nice work!

I just have some minor cosmetic comments:

1. Since these strings are passed to a debug callback as well, we cannot do
too many assumptions on how they will appear to users, I mean apart from how
the curl tool shows them. We can in fact make curl use a debug callback and
precent it from outputting that second astersisk, if we really think that its
worth the effort.

2. On my ipv6-enabled Linux host, I got some funny output on that home.nl host
   (indeed a good test host name!), see this snippet:

* About to connect() to ubr4-ca5-0-sec.landg1.lb.home.nl port 80
* Trying 10.221.110.1... * Success
* Trying 10.243.112.1... * Success
* Trying 82.72.140.1... * Success
* Trying 82.73.204.1... * Success
* Trying 217.121.93.1... * Success
* Trying 217.122.53.1... * Success
* Trying 217.123.132.1... * Success
* Closing connection #0
curl: (7) couldn't connect

The good news is that I found the two problems that caused this -
verifyconnect() was called twice and the second time it always got error 0.
But even with this fix I still got Success on the 10.* addresses, which turned
out to be because I get a timeout on those connects and then error is 0 too.

With these edits, I committed!

> And this too, but the prototype is
> const char *Curl_printable_address (const Curl_ipconnect*, char*, size_t);
>
> Now moved to hostip.c

Thumbs up from me!

> Hopefully Curl_connecthost() is now easier to follow. IMHO we should make a
> more generic Curl_ipconnect. For IPv6, getaddrinfo() does the tidbits of
> filling the port and addr-type. Why can't we do this ourselves in hostip4.c
> or hostares.c so we don't need to fill the serv_addr again in
> Curl_connecthost and then url.c.

I agree completely. It would make sense to have all resolvers provide a
getaddrinfo()-style result with a linked list of data to use.

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