apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject cvs commit: apr/network_io/unix sockaddr.c
Date Tue, 01 Jun 2004 19:50:14 GMT
jorton      2004/06/01 12:50:14

  Modified:    network_io/unix sockaddr.c
  Log:
  * network_io/unix/sockaddr.c (call_resolver): Fix lookups with NULL
  hostname for Tru64 5.0 getaddrinfo(), which doesn't handle non-NULL
  servname arguments very well.
  
  Revision  Changes    Path
  1.52      +13 -1     apr/network_io/unix/sockaddr.c
  
  Index: sockaddr.c
  ===================================================================
  RCS file: /home/cvs/apr/network_io/unix/sockaddr.c,v
  retrieving revision 1.51
  retrieving revision 1.52
  diff -d -u -r1.51 -r1.52
  --- sockaddr.c	23 May 2004 17:26:38 -0000	1.51
  +++ sockaddr.c	1 Jun 2004 19:50:14 -0000	1.52
  @@ -309,6 +309,17 @@
           /* getaddrinfo according to RFC 2553 must have either hostname
            * or servname non-NULL.
            */
  +#ifdef OSF1
  +        /* The Tru64 5.0 getaddrinfo() can only resolve services given
  +         * by the name listed in /etc/services; a numeric or unknown
  +         * servname gets an EAI_SERVICE error.  So just resolve the
  +         * appropriate anyaddr and fill in the port later. */
  +        hostname = family == AF_INET6 ? "::" : "0.0.0.0";
  +        servname = NULL;
  +#ifdef AI_NUMERICHOST
  +        hints.ai_flags |= AI_NUMERICHOST;
  +#endif
  +#else
   #ifdef _AIX
           /* But current AIX getaddrinfo() doesn't like servname = "0";
            * the "1" won't hurt since we use the port parameter to fill
  @@ -318,8 +329,9 @@
               servname = "1";
           }
           else
  -#endif
  +#endif /* _AIX */
           servname = apr_itoa(p, port);
  +#endif /* OSF1 */
       }
       error = getaddrinfo(hostname, servname, &hints, &ai_list);
   #ifdef HAVE_GAI_ADDRCONFIG
  
  
  

Mime
View raw message