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 sockets.c
Date Thu, 16 Nov 2000 17:31:33 GMT
trawick     00/11/16 09:31:33

  Modified:    src/lib/apr/include/arch/win32 networkio.h
               src/lib/apr/network_io/unix inet_ntop.c
               src/lib/apr/network_io/win32 sockets.c
  Log:
  Get Win32 closer to building with updated network_io API.
  
  Revision  Changes    Path
  1.15      +3 -0      apache-2.0/src/lib/apr/include/arch/win32/networkio.h
  
  Index: networkio.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/include/arch/win32/networkio.h,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- networkio.h	2000/11/16 01:51:36	1.14
  +++ networkio.h	2000/11/16 17:31:24	1.15
  @@ -81,5 +81,8 @@
   
   apr_status_t status_from_res_error(int);
   
  +const char *apr_inet_ntop(int af, const void *src, char *dst, apr_size_t size);
  +int apr_inet_pton(int af, const char *src, void *dst);
  +
   #endif  /* ! NETWORK_IO_H */
   
  
  
  
  1.3       +4 -0      apache-2.0/src/lib/apr/network_io/unix/inet_ntop.c
  
  Index: inet_ntop.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/unix/inet_ntop.c,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- inet_ntop.c	2000/11/16 15:28:55	1.2
  +++ inet_ntop.c	2000/11/16 17:31:25	1.3
  @@ -45,6 +45,10 @@
   #define __P(x) x
   #endif
   
  +#if !defined(EAFNOSUPPORT) && defined(WSAEAFNOSUPPORT)
  +#define EAFNOSUPPORT WSAEAFNOSUPPORT
  +#endif
  +
   #define SPRINTF(x) ((size_t)sprintf x)
   
   /*
  
  
  
  1.41      +24 -1     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.40
  retrieving revision 1.41
  diff -u -r1.40 -r1.41
  --- sockets.c	2000/11/16 01:51:36	1.40
  +++ sockets.c	2000/11/16 17:31:25	1.41
  @@ -112,8 +112,19 @@
                                                           sizeof(apr_sockaddr_t));
   }
   
  -apr_status_t apr_create_tcp_socket(apr_socket_t **new, apr_pool_t *cont)
  +apr_status_t apr_create_socket(apr_socket_t **new, int ofamily, int type,
  +                               apr_pool_t *cont)
   {
  +    int family = ofamily;
  +
  +    if (family == AF_UNSPEC) {
  +#if APR_HAVE_IPV6
  +        family = AF_INET6;
  +#else
  +        family = AF_INET;
  +#endif
  +    }
  +
       alloc_socket(new, cont);
   
       if ((*new) == NULL) {
  @@ -127,6 +138,13 @@
        * No flags to use when creating a socket, so use 0 for that parameter as well.
        */
       (*new)->sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
  +#if APR_HAVE_IPV6
  +    if ((*new)->sock == INVALID_SOCKET && ofamily == AF_UNSPEC) {
  +        family = AF_INET;
  +        (*new)->sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
  +    }
  +#endif
  +
       if ((*new)->sock == INVALID_SOCKET) {
           return apr_get_netos_error();
       }
  @@ -140,6 +158,11 @@
   
       return APR_SUCCESS;
   } 
  +
  +apr_status_t apr_create_tcp_socket(apr_socket_t **new, apr_pool_t *cont)
  +{
  +    return apr_create_socket(new, AF_INET, SOCK_STREAM, cont);
  +}
   
   apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how)
   {
  
  
  

Mime
View raw message