Subject: Re: release and A instead of AAAA?

Re: release and A instead of AAAA?

From: Tommie Gannert <tommie_at_spotify.com>
Date: Wed, 08 Dec 2010 16:09:13 +0100

Steinar H. Gunderson wrote:
>> In libcurl we might start doing duplicate calls to ares_gethostbyname(), one
>> for AF_INET and one for AF_INET6 and that logic gives us duplicated A
>> entries at times!
>>
>
> That sounds like a libcurl bug…?
>
The problem is that IPv6 addresses are not always usable,
so libcurl must have some IPv4 addresses to fall back to if
IPv6 fails connection (but was returned from DNS). Since
struct hostent only can return a single address family,
we have to make two queries.

That works, but if the IPv6 query falls back to IPv4, we get
duplicate entries. It's not a big deal, but somewhat ugly.

The GAI function of glibc seems to be actively trying to connect
to hosts before returning the addresses, which feels like overkill
since libcurl already has retry logic itself.

-- 
Tommie

Received on 2010-12-08