bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: getaddrinfo test: ignore failure on AIX


From: Simon Josefsson
Subject: Re: getaddrinfo test: ignore failure on AIX
Date: Tue, 15 Apr 2008 05:35:02 +0200
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1 (gnu/linux)

Bruno Haible <address@hidden> writes:

>> One idea would be a gnulib module to implement a replacement
>> getservbyname function that supports all the IANA registered names, or
>> at least also supports https.
>
> Why only https then? I would use a reasonably complete list, and precompile
> it using gperf (to speed up the search).

Some reasons:

1) Supporting a complete list takes up a lot of size.  Not all projects
use non-numeric service fields in getaddrinfo, so it can be wasteful.

2) Hard coding the service <-> port mappings breaks the ability to
modify port numbers by editing /etc/services or using NIS or whatever.
I'm not sure if there is ever a valid reason to modify port numbers this
way, but I think it will be surprising if we break this old tradition.

3) Detecting whether the system's internal getaddrinfo has failed only
because of an unsupported service may be trickier.  Based on your work,
we now know that 'https' fail in a specific way even though 'http' for
the same name works, on two specific systems.  We could add a wrapper
to, on these error codes and for these systems, re-try any failed call
for "https" with a call for "443", to see if that succeeds.  If we
re-try (failed) queries for, say 'http', too, we may introduce
surprising behavior: consider if the system maps 'http' to port 8080,
and that lookup fails because no such service is registered [1], and we
re-try it using port 80 instead, which could succeed.

None of these are particular strong reasons, or perhaps even valid
reason, but to me they are together good reasons to make any behavior
like this optional.

/Simon

[1] I'm assuming here that getaddrinfo uses NIS (or possibly something
like SRV records) so that lookups can fail because there is no service
on that address, even though the address itself is valid.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]