In article <14714.49812.215244.768241(a)mule.m17n.org> (at Sun, 23 Jul 2000 19:01:56
+0900 (JST)), Martin Buchholz <martin(a)xemacs.org> says:
>>>>> "Ben" == Ben Wing <ben(a)666.com>
writes:
Ben> agreed -- although getaddrinfo[] is hardly necessary [no one
Ben> really has ipv6 networks yet!], and it looks very bad when we
Ben> just hang indefinitely at startup. perhaps we should just set a
Ben> 30-second timer when we call this function, and forcibly
Ben> longjmp[] if we get stuck, outputting a warning message to
Ben> stderr.
Given that getaddrinfo is not used in 21.1, and is used in 21.2, which
is still beta, the timing is not so bad, assuming that the world will
be forced to convert to ipv6 in the next year or two.
Perhaps URA Hiroshi or YOSHIFUJI Hideaki can comment on getaddrinfo()
and which implementations are known to be broken? And how to test for
them? (I'm thinking of a glibc version test).
What do you mean by "which implementation"?
(gethostbyname() vs getaddrinfo() ???)
If so, use getaddrinfo().
One solution against the problem that it would take long time to
resolve names is to define a new runtime-configuration variable
which selects protocol family being given to getaddrinfo()
through 'hints':
:
memset(&hints, 0, sizeof(hints));
hints.ai_familt = af; /* <= set this value by configuration variable:
PF_UNSPEC: IPv6->IPv4 (default)
PF_INET : IPv4
PF_INET6 : IPV6
xemacs' default should be PF_UNSPEC, but
it may be configurable by autoconf.
Even in this case, xemacs MUST allow
users to set this value through
runtime-variable by thamselves:
Red Hat can set configuration variable
PF_INET by default, but users MUST be
able to change that to PF_UNSPEC. */
hints.ai_socktype = SOCK_STREAM;
gai = getaddrinfo(host, serv, &hints, &ai);
if (gai){
fprintf(stderr, "%s port %s: %s\n", host, serv, gai_strerror(gai));
return -1;
}
:
--
Hideaki YOSHIFUJI <yoshfuji(a)ecei.tohoku.ac.jp>
Web Page:
http://www.ecei.tohoku.ac.jp/%7Eyoshfuji/
PGP5i FP: F731 6599 5EB2 BBA7 1515 1323 1806 A96F 5700 6B25