httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Stein <gst...@lyra.org>
Subject Re: cvs commit: apache-2.0/src/lib/apr/network_io/unix sa_common.c
Date Thu, 09 Nov 2000 19:28:57 GMT
On Thu, Nov 09, 2000 at 04:05:26PM -0000, dreid@locus.apache.org wrote:
> dreid       00/11/09 08:05:25
> 
>   Added:       src/lib/apr/network_io/unix sa_common.c
>...
>   apr_status_t apr_get_inaddr(apr_in_addr *addr, char *hostname)
>   {
>       struct hostent *he;
>   
>       if (strcmp(hostname,"*") == 0){
>           addr->s_addr = htonl(INADDR_ANY);
>           return APR_SUCCESS;
>       }
>       if ((addr->s_addr = apr_inet_addr(hostname)) != INADDR_NONE)
>           return APR_SUCCESS;
>   
>       /* hmmm, it's not a numeric IP address so we need to look it up :( */
>       he = gethostbyname(hostname);
>       if (!he || he->h_addrtype != AF_INET || !he->h_addr_list[0])
>           return (h_errno + APR_OS_START_SYSERR);
>   
>       addr = (struct in_addr*)he->h_addr_list[0];

That last line there isn't going to be very helpful :-)

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

Mime
View raw message