diff options
author | Jeff Trawick <trawick@apache.org> | 2002-03-14 19:28:15 +0000 |
---|---|---|
committer | Jeff Trawick <trawick@apache.org> | 2002-03-14 19:28:15 +0000 |
commit | 00e034e2a66b133d092fbbdabbaeecac42b0ec22 (patch) | |
tree | 39cccccfa747e438987dfd9af779e0c508897346 /network_io | |
parent | d78733896ca088d3b2cc92eaa548c5153715c34d (diff) | |
download | apr-00e034e2a66b133d092fbbdabbaeecac42b0ec22.tar.gz |
slight apr_sockaddr_info_get() simplification/speed-up:
in the getaddrinfo() flavor we were needlessly building a
string form of the port number to pass to getaddrinfo() so
it would put it in the sockaddrs it built... but then we
stuffed the port number in the sockaddrs anyway
given that we no longer need getaddrinfo() to be able to
handle port numbers properly, there is no sense checking for
that ability at configure time
suddenly we think that AIX 4.3.3.no-fixes has a working
getaddrinfo() (it previously failed the pass-the-port-number-
to-getaddrinfo check)
but that level of AIX doesn't fill in the family field in
the sockaddrs built by getaddrinfo()... rather than kludge
around it in apr_sockaddr_info_get(), it is better to change
the configure test to refuse to use getaddrinfo() on such a
system
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@63125 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'network_io')
-rw-r--r-- | network_io/unix/sa_common.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/network_io/unix/sa_common.c b/network_io/unix/sa_common.c index d0c607495..2f62d612a 100644 --- a/network_io/unix/sa_common.c +++ b/network_io/unix/sa_common.c @@ -352,8 +352,6 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, struct addrinfo hints, *ai, *ai_list; apr_sockaddr_t *cursa; int error; - char num[8]; - char *numptr; memset(&hints, 0, sizeof(hints)); hints.ai_flags = 0; /* XXX: might need a way to turn on AI_CANONNAME */ @@ -368,14 +366,7 @@ APR_DECLARE(apr_status_t) apr_sockaddr_info_get(apr_sockaddr_t **sa, hints.ai_family = family; hints.ai_socktype = SOCK_STREAM; hints.ai_protocol = 0; - if (port) { - apr_snprintf(num, sizeof(num), "%d", port); - numptr = num; - } - else { - numptr = NULL; - } - error = getaddrinfo(hostname, numptr, &hints, &ai_list); + error = getaddrinfo(hostname, NULL, &hints, &ai_list); if (error) { if (error == EAI_SYSTEM) { return errno; |