httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dr...@locus.apache.org
Subject cvs commit: apache-2.0/src/lib/apr/network_io/beos sockets.c
Date Thu, 02 Nov 2000 14:15:09 GMT
dreid       00/11/02 06:15:04

  Modified:    src/lib/apr/network_io/beos sockets.c
  Log:
  Add error checking for apr_connect.
  
  Submitted by:  Jeff Trawick <trawick@locus.apache.org>
  
  Revision  Changes    Path
  1.35      +9 -4      apache-2.0/src/lib/apr/network_io/beos/sockets.c
  
  Index: sockets.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/beos/sockets.c,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- sockets.c	2000/11/02 03:02:45	1.34
  +++ sockets.c	2000/11/02 14:15:00	1.35
  @@ -165,12 +165,17 @@
   { 
       struct hostent *hp; 
   
  -    hp = gethostbyname(hostname); 
  -    if ((sock->socketdes < 0) || (!sock->remote_addr)) { 
  -        return APR_ENOTSOCK; 
  -    } 
  +    if ((sock->socketdes < 0) || (!sock->remote_addr)) {
  +        return APR_ENOTSOCK;
  +    }
   
  +    if (hostname != NULL){
  +        hp = gethostbyname(hostname); 
  +        if (!hp)
  +            return (h_errno + APR_OS_START_SYSERR);
  +
   	memcpy((char *)&sock->remote_addr->sin_addr, hp->h_addr , hp->h_length);
  +    }
   
       sock->remote_addr->sin_family = AF_INET;
        
  
  
  

Mime
View raw message