httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@locus.apache.org
Subject cvs commit: apache-2.0/src/lib/apr/network_io/win32 sockopt.c sockets.c networkio.h
Date Mon, 03 Apr 2000 04:52:14 GMT
trawick     00/04/02 21:52:14

  Modified:    src/lib/apr/network_io/win32 sockopt.c sockets.c networkio.h
  Log:
  Return the right APR error code after a resolver failure
  on Win32.
  
  Revision  Changes    Path
  1.9       +22 -6     apache-2.0/src/lib/apr/network_io/win32/sockopt.c
  
  Index: sockopt.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/win32/sockopt.c,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- sockopt.c	2000/03/31 08:36:16	1.8
  +++ sockopt.c	2000/04/03 04:52:13	1.9
  @@ -156,13 +156,29 @@
           return APR_ENOMEM;
       }
   
  -    /* XXX - I don't know what the correct way to deal with host resolution
  -     * errors on Windows is. WSAGetLastError() seems to use a different set of
  -     * error numbers than APR does. The previous code didn't deal with them at
  -     * all.  - manoj
  -     */
  +    return status_from_res_error(WSAGetLastError());
  +}
   
  -    return h_errno;
  +ap_status_t status_from_res_error(int reserr)
  +{
  +    ap_status_t status;
  +    switch(reserr) {
  +    case WSAHOST_NOT_FOUND:
  +        status = APR_EHOSTNOTFOUND;
  +        break;
  +    case WSATRY_AGAIN:
  +        status = APR_EAGAIN;
  +        break;
  +    case WSANO_RECOVERY:
  +        status = APR_ENORECOVERY;
  +        break;
  +    case WSANO_DATA:
  +        status = APR_ENODATA;
  +        break;
  +    default:
  +        status = APR_ENORECOVERY;
  +    }
  +    return status;
   }
   
   
  
  
  
  1.21      +3 -6      apache-2.0/src/lib/apr/network_io/win32/sockets.c
  
  Index: sockets.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/win32/sockets.c,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- sockets.c	2000/03/31 08:36:16	1.20
  +++ sockets.c	2000/04/03 04:52:13	1.21
  @@ -200,14 +200,11 @@
       }
       else {
           hp = gethostbyname(hostname);
  -        memcpy((char *)&sock->remote_addr->sin_addr, hp->h_addr_list[0], hp->h_length);
  -        sock->addr_len = sizeof(*sock->remote_addr);
           if (!hp)  {
  -            if (h_errno == TRY_AGAIN) {
  -                return EAGAIN;
  -            }
  -            return h_errno;
  +            return status_from_res_error(WSAGetLastError());
           }
  +        memcpy((char *)&sock->remote_addr->sin_addr, hp->h_addr_list[0], hp->h_length);
  +        sock->addr_len = sizeof(*sock->remote_addr);
       }
       
       sock->remote_addr->sin_family = AF_INET;
  
  
  
  1.7       +2 -0      apache-2.0/src/lib/apr/network_io/win32/networkio.h
  
  Index: networkio.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/win32/networkio.h,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- networkio.h	2000/03/31 08:36:16	1.6
  +++ networkio.h	2000/04/03 04:52:13	1.7
  @@ -77,5 +77,7 @@
       int numexcept;    
   };
   
  +ap_status_t status_from_res_error(int);
  +
   #endif  /* ! NETWORK_IO_H */
   
  
  
  

Mime
View raw message