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/test client.c server.c testsf.c
Date Sat, 18 Nov 2000 15:46:46 GMT
dreid       00/11/18 07:46:46

  Modified:    src/lib/apr/include apr_network_io.h
               src/lib/apr/network_io/unix sa_common.c sockets.c sockopt.c
               src/lib/apr/test client.c server.c testsf.c
  Log:
  This changes AF_ to APR_.  The reason is that if we're on a platform
  (pre-BONE BeOS for example) that doesn't have AF_UNSPEC then we need
  to define it and any program using our code needs to use the value
  we've defined.  I'm not in favour of mixing AF_INET and APR_UNSPEC so
  we now have APR_INET, APR_INET6 and APR_UNSPEC.
  
  Revision  Changes    Path
  1.74      +13 -0     apache-2.0/src/lib/apr/include/apr_network_io.h
  
  Index: apr_network_io.h
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/include/apr_network_io.h,v
  retrieving revision 1.73
  retrieving revision 1.74
  diff -u -r1.73 -r1.74
  --- apr_network_io.h	2000/11/17 16:16:03	1.73
  +++ apr_network_io.h	2000/11/18 15:46:45	1.74
  @@ -113,6 +113,19 @@
   }
   #endif
   
  +/* Not all platforms have these defined, so we'll define them here
  + * The default values come from FreeBSD 4.1.1
  + */
  +#define APR_INET     AF_INET
  +#ifdef AF_UNSPEC
  +#define APR_UNSPEC   AF_UNSPEC
  +#else
  +#define APR_UNSPEC   0
  +#endif
  +#if APR_HAVE_IPV6
  +#define APR_INET6    AF_INET6
  +#endif
  +
   /* Enum to tell us if we're interested in remote or local socket */
   typedef enum {
       APR_LOCAL,
  
  
  
  1.8       +4 -4      apache-2.0/src/lib/apr/network_io/unix/sa_common.c
  
  Index: sa_common.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/unix/sa_common.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- sa_common.c	2000/11/17 03:45:01	1.7
  +++ sa_common.c	2000/11/18 15:46:45	1.8
  @@ -140,7 +140,7 @@
   
       /* 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])
  +    if (!he || he->h_addrtype != APR_INET || !he->h_addr_list[0])
           return (h_errno + APR_OS_START_SYSERR);
   
       *addr = *(struct in_addr*)he->h_addr_list[0];
  @@ -175,14 +175,14 @@
   {
       addr->sa.sin.sin_family = family;
   
  -    if (family == AF_INET) {
  +    if (family == APR_INET) {
           addr->sa_len = sizeof(struct sockaddr_in);
           addr->addr_str_len = 16;
           addr->ipaddr_ptr = &(addr->sa.sin.sin_addr);
           addr->ipaddr_len = sizeof(struct in_addr);
       }
   #if APR_HAVE_IPV6
  -    else if (family == AF_INET6) {
  +    else if (family == APR_INET6) {
           addr->sa_len = sizeof(struct sockaddr_in6);
           addr->addr_str_len = 46;
           addr->ipaddr_ptr = &(addr->sa.sin6.sin6_addr);
  @@ -201,7 +201,7 @@
       if ((*sa) == NULL)
           return APR_ENOMEM;
       (*sa)->pool = p;
  -    (*sa)->sa.sin.sin_family = AF_INET; /* we don't yet support IPv6 */
  +    (*sa)->sa.sin.sin_family = APR_INET; /* we don't yet support IPv6 */
       (*sa)->sa.sin.sin_port = htons(port);
       set_sockaddr_vars(*sa, (*sa)->sa.sin.sin_family);
   
  
  
  
  1.59      +10 -10    apache-2.0/src/lib/apr/network_io/unix/sockets.c
  
  Index: sockets.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/unix/sockets.c,v
  retrieving revision 1.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- sockets.c	2000/11/18 15:32:16	1.58
  +++ sockets.c	2000/11/18 15:46:45	1.59
  @@ -76,7 +76,7 @@
       sock->local_addr->sa.sin.sin_family = family;
       sock->remote_addr->sa.sin.sin_family = family;
   
  -    if (family == AF_INET) {
  +    if (family == APR_INET) {
           sock->local_addr->sa_len = sizeof(struct sockaddr_in);
           sock->local_addr->addr_str_len = 16;
           sock->local_addr->ipaddr_ptr = &(sock->local_addr->sa.sin.sin_addr);
  @@ -88,7 +88,7 @@
           sock->remote_addr->ipaddr_len = sizeof(struct in_addr);
       }
   #if APR_HAVE_IPV6
  -    else if (family == AF_INET6) {
  +    else if (family == APR_INET6) {
           sock->local_addr->sa_len = sizeof(struct sockaddr_in6);
           sock->local_addr->addr_str_len = 46;
           sock->local_addr->ipaddr_ptr = &(sock->local_addr->sa.sin6.sin6_addr);
  @@ -116,11 +116,11 @@
   {
       int family = ofamily;
   
  -    if (family == AF_UNSPEC) {
  +    if (family == APR_UNSPEC) {
   #if APR_HAVE_IPV6
  -        family = AF_INET6;
  +        family = APR_INET6;
   #else
  -        family = AF_INET;
  +        family = APR_INET;
   #endif
       }
   
  @@ -133,8 +133,8 @@
       (*new)->socketdes = socket(family, type, 0);
   
   #if APR_HAVE_IPV6
  -    if ((*new)->socketdes < 0 && ofamily == AF_UNSPEC) {
  -        family = AF_INET;
  +    if ((*new)->socketdes < 0 && ofamily == APR_UNSPEC) {
  +        family = APR_INET;
           (*new)->socketdes = socket(family, type, 0);
       }
   #endif
  @@ -152,7 +152,7 @@
   
   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);
  +    return apr_create_socket(new, APR_INET, SOCK_STREAM, cont);
   }
   
   apr_status_t apr_shutdown(apr_socket_t *thesocket, apr_shutdown_how_e how)
  @@ -251,7 +251,7 @@
           }
           /* XXX IPv6 to be handled better later... */
   #if APR_HAVE_IPV6
  -        if (sock->local_addr->sa.sin.sin_family == AF_INET6 ||
  +        if (sock->local_addr->sa.sin.sin_family == APR_INET6 ||
               sock->local_addr->sa.sin.sin_addr.s_addr == 0) {
               /* not bound to specific local interface; connect() had to assign
                * one for the socket
  @@ -289,7 +289,7 @@
       if ((*sock) == NULL) {
           alloc_socket(sock, cont);
           /* XXX IPv6 figure out the family here! */
  -        set_socket_vars(*sock, AF_INET);
  +        set_socket_vars(*sock, APR_INET);
           (*sock)->timeout = -1;
       }
       (*sock)->local_port_unknown = (*sock)->local_interface_unknown = 1;
  
  
  
  1.38      +1 -1      apache-2.0/src/lib/apr/network_io/unix/sockopt.c
  
  Index: sockopt.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/network_io/unix/sockopt.c,v
  retrieving revision 1.37
  retrieving revision 1.38
  diff -u -r1.37 -r1.38
  --- sockopt.c	2000/11/16 01:51:35	1.37
  +++ sockopt.c	2000/11/18 15:46:45	1.38
  @@ -214,7 +214,7 @@
       else
           return APR_EINVAL;
   
  -    hptr = gethostbyaddr((char *)&sa_ptr, sizeof(struct in_addr), AF_INET);
  +    hptr = gethostbyaddr((char *)&sa_ptr, sizeof(struct in_addr), APR_INET);
   
       if (hptr != NULL) {
           *name = apr_pstrdup(sock->cntxt, hptr->h_name);
  
  
  
  1.19      +1 -1      apache-2.0/src/lib/apr/test/client.c
  
  Index: client.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/test/client.c,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- client.c	2000/11/17 03:45:01	1.18
  +++ client.c	2000/11/18 15:46:45	1.19
  @@ -117,7 +117,7 @@
       }
   
       fprintf(stdout,"\tClient:  Making socket address...............");
  -    if (apr_getaddrinfo(&destsa, dest, AF_INET, 8021, 0, context) != APR_SUCCESS) {
  +    if (apr_getaddrinfo(&destsa, dest, APR_INET, 8021, 0, context) != APR_SUCCESS)
{
           apr_close_socket(sock);
           fprintf(stdout, "Failed!\n");
           fprintf(stdout, "Couldn't create a socket address structure for %s\n", dest);
  
  
  
  1.19      +1 -1      apache-2.0/src/lib/apr/test/server.c
  
  Index: server.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/test/server.c,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- server.c	2000/11/16 14:48:50	1.18
  +++ server.c	2000/11/18 15:46:45	1.19
  @@ -88,7 +88,7 @@
       fprintf(stdout, "OK\n");
   
       fprintf(stdout, "\tServer:  Creating new socket.......");
  -    if (apr_create_socket(&sock, AF_UNSPEC, SOCK_STREAM, context) != APR_SUCCESS) {
  +    if (apr_create_socket(&sock, APR_UNSPEC, SOCK_STREAM, context) != APR_SUCCESS)
{
           fprintf(stderr, "Couldn't create socket\n");
           exit(-1);
       }
  
  
  
  1.15      +1 -1      apache-2.0/src/lib/apr/test/testsf.c
  
  Index: testsf.c
  ===================================================================
  RCS file: /home/cvs/apache-2.0/src/lib/apr/test/testsf.c,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- testsf.c	2000/11/17 03:45:01	1.14
  +++ testsf.c	2000/11/18 15:46:45	1.15
  @@ -218,7 +218,7 @@
           exit(1);
       }
   
  -    rv = apr_getaddrinfo(&destsa, "127.0.0.1", AF_INET, TESTSF_PORT, 0, p);
  +    rv = apr_getaddrinfo(&destsa, "127.0.0.1", APR_INET, TESTSF_PORT, 0, p);
       if (rv != APR_SUCCESS) {
           fprintf(stderr, "apr_getaddrinfo()->%d/%s\n",
                   rv,
  
  
  

Mime
View raw message