apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@locus.apache.org
Subject cvs commit: apr/network_io/win32 sockaddr.c sockets.c
Date Tue, 21 Nov 2000 21:33:09 GMT
rbb         00/11/21 13:33:08

  Modified:    .        CHANGES
               include  apr_network_io.h
               network_io/os2 sockets.c
               network_io/unix sa_common.c sockaddr.c sockets.c
               network_io/win32 sockaddr.c sockets.c
  Log:
  Rename sa_len to salen in apr_sockaddr_t.  Some platforms have a macro
  named sa_len,  and this was confusing them
  PR:     6874
  Submitted by:   Tony Finch
  
  Revision  Changes    Path
  1.4       +4 -0      apr/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/apr/CHANGES,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- CHANGES	2000/11/21 19:08:29	1.3
  +++ CHANGES	2000/11/21 21:33:04	1.4
  @@ -1,4 +1,8 @@
   Changes with APR a8
  +  *) Change the name of the sa_len field in apr_sockaddr_t to salen.
  +     Some platforms have a macro named sa_len.
  +     [Tony Finch]
  +
     *) apr_set_port(), apr_get_port(), apr_set_ipaddr(), and apr_get_ipaddr()
        now take apr_sockaddr_t as a parameter instead of apr_socket_t +
        apr_interface_e.  This will allow the same routines to be used with
  
  
  
  1.80      +1 -1      apr/include/apr_network_io.h
  
  Index: apr_network_io.h
  ===================================================================
  RCS file: /home/cvs/apr/include/apr_network_io.h,v
  retrieving revision 1.79
  retrieving revision 1.80
  diff -u -r1.79 -r1.80
  --- apr_network_io.h	2000/11/21 21:17:27	1.79
  +++ apr_network_io.h	2000/11/21 21:33:05	1.80
  @@ -170,7 +170,7 @@
           struct sockaddr_in6 sin6;  /* IPv6 sockaddr structure */
   #endif
       } sa;
  -    apr_socklen_t sa_len;          /* How big is the sockaddr we're using? */
  +    apr_socklen_t salen;          /* How big is the sockaddr we're using? */
       int ipaddr_len;                /* How big is the ip address structure
                                       * we're using? 
                                       */
  
  
  
  1.35      +7 -7      apr/network_io/os2/sockets.c
  
  Index: sockets.c
  ===================================================================
  RCS file: /home/cvs/apr/network_io/os2/sockets.c,v
  retrieving revision 1.34
  retrieving revision 1.35
  diff -u -r1.34 -r1.35
  --- sockets.c	2000/11/21 00:30:43	1.34
  +++ sockets.c	2000/11/21 21:33:06	1.35
  @@ -89,24 +89,24 @@
       sock->remote_addr->sa.sin.sin_family = family;
   
       if (family == AF_INET) {
  -        sock->local_addr->sa_len = sizeof(struct sockaddr_in);
  +        sock->local_addr->salen = sizeof(struct sockaddr_in);
           sock->local_addr->addr_str_len = 16;
           sock->local_addr->ipaddr_ptr = &(sock->local_addr->sa.sin.sin_addr);
           sock->local_addr->ipaddr_len = sizeof(struct in_addr);
   
  -        sock->remote_addr->sa_len = sizeof(struct sockaddr_in);
  +        sock->remote_addr->salen = sizeof(struct sockaddr_in);
           sock->remote_addr->addr_str_len = 16;
           sock->remote_addr->ipaddr_ptr = &(sock->remote_addr->sa.sin.sin_addr);
           sock->remote_addr->ipaddr_len = sizeof(struct in_addr);
       }
   #if APR_HAVE_IPV6
       else if (family == AF_INET6) {
  -        sock->local_addr->sa_len = sizeof(struct sockaddr_in6);
  +        sock->local_addr->salen = sizeof(struct sockaddr_in6);
           sock->local_addr->addr_str_len = 46;
           sock->local_addr->ipaddr_ptr = &(sock->local_addr->sa.sin6.sin6_addr);
           sock->local_addr->ipaddr_len = sizeof(struct in6_addr);
   
  -        sock->remote_addr->sa_len = sizeof(struct sockaddr_in6);
  +        sock->remote_addr->salen = sizeof(struct sockaddr_in6);
           sock->remote_addr->addr_str_len = 46;
           sock->remote_addr->ipaddr_ptr = &(sock->remote_addr->sa.sin6.sin6_addr);
           sock->remote_addr->ipaddr_len = sizeof(struct in6_addr);
  @@ -188,7 +188,7 @@
   {
       if (bind(sock->socketdes, 
                (struct sockaddr *)&sa->sa,
  -             sa->sa_len) == -1)
  +             sa->salen) == -1)
           return APR_OS2_STATUS(sock_errno());
       else {
           sock->local_sa = sa;
  @@ -214,7 +214,7 @@
   
       (*new)->socketdes = accept(sock->socketdes, 
                                  (struct sockaddr *)&(*new)->remote_addr->sa,
  -                               &(*new)->remote_addr->sa_len);
  +                               &(*new)->remote_addr->salen);
   
       if ((*new)->socketdes < 0) {
           return APR_OS2_STATUS(sock_errno());
  @@ -228,7 +228,7 @@
   apr_status_t apr_connect(apr_socket_t *sock, apr_sockaddr_t *sa)
   {
       if ((connect(sock->socketdes, (struct sockaddr *)&sa->sa.sin, 
  -                 sa->sa_len) < 0) &&
  +                 sa->salen) < 0) &&
           (sock_errno() != SOCEINPROGRESS)) {
           return APR_OS2_STATUS(sock_errno());
       }
  
  
  
  1.13      +4 -4      apr/network_io/unix/sa_common.c
  
  Index: sa_common.c
  ===================================================================
  RCS file: /home/cvs/apr/network_io/unix/sa_common.c,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- sa_common.c	2000/11/21 21:17:25	1.12
  +++ sa_common.c	2000/11/21 21:33:06	1.13
  @@ -164,14 +164,14 @@
       addr->sa.sin.sin_family = family;
   
       if (family == APR_INET) {
  -        addr->sa_len = sizeof(struct sockaddr_in);
  +        addr->salen = 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 == APR_INET6) {
  -        addr->sa_len = sizeof(struct sockaddr_in6);
  +        addr->salen = sizeof(struct sockaddr_in6);
           addr->addr_str_len = 46;
           addr->ipaddr_ptr = &(addr->sa.sin6.sin6_addr);
           addr->ipaddr_len = sizeof(struct in6_addr);
  @@ -266,7 +266,7 @@
           if (*hostname >= '0' && *hostname <= '9' &&
               strspn(hostname, "0123456789.") == strlen(hostname)) {
               (*sa)->sa.sin.sin_addr.s_addr = inet_addr(hostname);
  -            (*sa)->sa_len = sizeof(struct sockaddr_in);
  +            (*sa)->salen = sizeof(struct sockaddr_in);
           }
           else {
   #endif
  @@ -282,7 +282,7 @@
   
           memcpy((char *)&(*sa)->sa.sin.sin_addr, hp->h_addr_list[0],
                  hp->h_length);
  -        (*sa)->sa_len = sizeof(struct sockaddr_in);
  +        (*sa)->salen = sizeof(struct sockaddr_in);
           (*sa)->ipaddr_len = hp->h_length;
   
   #ifndef GETHOSTBYNAME_HANDLES_NAS
  
  
  
  1.24      +2 -2      apr/network_io/unix/sockaddr.c
  
  Index: sockaddr.c
  ===================================================================
  RCS file: /home/cvs/apr/network_io/unix/sockaddr.c,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- sockaddr.c	2000/11/21 19:08:26	1.23
  +++ sockaddr.c	2000/11/21 21:33:06	1.24
  @@ -57,9 +57,9 @@
   
   static apr_status_t get_local_addr(apr_socket_t *sock)
   {
  -    sock->local_addr->sa_len = sizeof(sock->local_addr->sa);
  +    sock->local_addr->salen = sizeof(sock->local_addr->sa);
       if (getsockname(sock->socketdes, (struct sockaddr *)&sock->local_addr->sa,
  -                    &sock->local_addr->sa_len) < 0) {
  +                    &sock->local_addr->salen) < 0) {
           return errno;
       }
       else {
  
  
  
  1.65      +8 -8      apr/network_io/unix/sockets.c
  
  Index: sockets.c
  ===================================================================
  RCS file: /home/cvs/apr/network_io/unix/sockets.c,v
  retrieving revision 1.64
  retrieving revision 1.65
  diff -u -r1.64 -r1.65
  --- sockets.c	2000/11/21 00:30:44	1.64
  +++ sockets.c	2000/11/21 21:33:07	1.65
  @@ -78,24 +78,24 @@
       sock->remote_addr->sa.sin.sin_family = family;
   
       if (family == APR_INET) {
  -        sock->local_addr->sa_len = sizeof(struct sockaddr_in);
  +        sock->local_addr->salen = sizeof(struct sockaddr_in);
           sock->local_addr->addr_str_len = 16;
           sock->local_addr->ipaddr_ptr = &(sock->local_addr->sa.sin.sin_addr);
           sock->local_addr->ipaddr_len = sizeof(struct in_addr);
   
  -        sock->remote_addr->sa_len = sizeof(struct sockaddr_in);
  +        sock->remote_addr->salen = sizeof(struct sockaddr_in);
           sock->remote_addr->addr_str_len = 16;
           sock->remote_addr->ipaddr_ptr = &(sock->remote_addr->sa.sin.sin_addr);
           sock->remote_addr->ipaddr_len = sizeof(struct in_addr);
       }
   #if APR_HAVE_IPV6
       else if (family == APR_INET6) {
  -        sock->local_addr->sa_len = sizeof(struct sockaddr_in6);
  +        sock->local_addr->salen = sizeof(struct sockaddr_in6);
           sock->local_addr->addr_str_len = 46;
           sock->local_addr->ipaddr_ptr = &(sock->local_addr->sa.sin6.sin6_addr);
           sock->local_addr->ipaddr_len = sizeof(struct in6_addr);
   
  -        sock->remote_addr->sa_len = sizeof(struct sockaddr_in6);
  +        sock->remote_addr->salen = sizeof(struct sockaddr_in6);
           sock->remote_addr->addr_str_len = 46;
           sock->remote_addr->ipaddr_ptr = &(sock->remote_addr->sa.sin6.sin6_addr);
           sock->remote_addr->ipaddr_len = sizeof(struct in6_addr);
  @@ -165,7 +165,7 @@
   apr_status_t apr_bind(apr_socket_t *sock, apr_sockaddr_t *sa)
   {
       if (bind(sock->socketdes, 
  -             (struct sockaddr *)&sa->sa, sa->sa_len) == -1) {
  +             (struct sockaddr *)&sa->sa, sa->salen) == -1) {
           return errno;
       }
       else {
  @@ -196,10 +196,10 @@
   #endif
       (*new)->timeout = -1;
       
  -    (*new)->remote_addr->sa_len = sizeof((*new)->remote_addr->sa);
  +    (*new)->remote_addr->salen = sizeof((*new)->remote_addr->sa);
       (*new)->socketdes = accept(sock->socketdes, 
                                  (struct sockaddr *)&(*new)->remote_addr->sa,
  -                               &(*new)->remote_addr->sa_len);
  +                               &(*new)->remote_addr->salen);
   
       if ((*new)->socketdes < 0) {
           return errno;
  @@ -236,7 +236,7 @@
   
       if ((connect(sock->socketdes,
                    (const struct sockaddr *)&sa->sa.sin,
  -                 sa->sa_len) < 0) &&
  +                 sa->salen) < 0) &&
           (errno != EINPROGRESS)) {
           return errno;
       }
  
  
  
  1.22      +2 -2      apr/network_io/win32/sockaddr.c
  
  Index: sockaddr.c
  ===================================================================
  RCS file: /home/cvs/apr/network_io/win32/sockaddr.c,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- sockaddr.c	2000/11/21 19:08:27	1.21
  +++ sockaddr.c	2000/11/21 21:33:07	1.22
  @@ -60,9 +60,9 @@
   
   static apr_status_t get_local_addr(apr_socket_t *sock)
   {
  -    sock->local_addr->sa_len = sizeof(sock->local_addr->sa);
  +    sock->local_addr->salen = sizeof(sock->local_addr->sa);
       if (getsockname(sock->sock, (struct sockaddr *)&sock->local_addr->sa,
  -                    &sock->local_addr->sa_len) < 0) {
  +                    &sock->local_addr->salen) < 0) {
           return apr_get_netos_error();
       }
       else {
  
  
  
  1.45      +8 -8      apr/network_io/win32/sockets.c
  
  Index: sockets.c
  ===================================================================
  RCS file: /home/cvs/apr/network_io/win32/sockets.c,v
  retrieving revision 1.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- sockets.c	2000/11/21 00:30:44	1.44
  +++ sockets.c	2000/11/21 21:33:08	1.45
  @@ -78,24 +78,24 @@
       sock->remote_addr->sa.sin.sin_family = family;
   
       if (family == AF_INET) {
  -        sock->local_addr->sa_len = sizeof(struct sockaddr_in);
  +        sock->local_addr->salen = sizeof(struct sockaddr_in);
           sock->local_addr->addr_str_len = 16;
           sock->local_addr->ipaddr_ptr = &(sock->local_addr->sa.sin.sin_addr);
           sock->local_addr->ipaddr_len = sizeof(struct in_addr);
   
  -        sock->remote_addr->sa_len = sizeof(struct sockaddr_in);
  +        sock->remote_addr->salen = sizeof(struct sockaddr_in);
           sock->remote_addr->addr_str_len = 16;
           sock->remote_addr->ipaddr_ptr = &(sock->remote_addr->sa.sin.sin_addr);
           sock->remote_addr->ipaddr_len = sizeof(struct in_addr);
       }
   #if APR_HAVE_IPV6
       else if (family == AF_INET6) {
  -        sock->local_addr->sa_len = sizeof(struct sockaddr_in6);
  +        sock->local_addr->salen = sizeof(struct sockaddr_in6);
           sock->local_addr->addr_str_len = 46;
           sock->local_addr->ipaddr_ptr = &(sock->local_addr->sa.sin6.sin6_addr);
           sock->local_addr->ipaddr_len = sizeof(struct in6_addr);
   
  -        sock->remote_addr->sa_len = sizeof(struct sockaddr_in6);
  +        sock->remote_addr->salen = sizeof(struct sockaddr_in6);
           sock->remote_addr->addr_str_len = 46;
           sock->remote_addr->ipaddr_ptr = &(sock->remote_addr->sa.sin6.sin6_addr);
           sock->remote_addr->ipaddr_len = sizeof(struct in6_addr);
  @@ -195,7 +195,7 @@
   {
       if (bind(sock->sock, 
                (struct sockaddr *)&sa->sa, 
  -             sa->sa_len) == -1) {
  +             sa->salen) == -1) {
           return apr_get_netos_error();
       }
       else {
  @@ -223,10 +223,10 @@
       (*new)->timeout = -1;   
       (*new)->disconnected = 0;
   
  -    (*new)->remote_addr->sa_len = sizeof((*new)->remote_addr->sa);
  +    (*new)->remote_addr->salen = sizeof((*new)->remote_addr->sa);
       (*new)->sock = accept(sock->sock, 
                             (struct sockaddr *)&(*new)->remote_addr->sa,
  -                          &(*new)->remote_addr->sa_len);
  +                          &(*new)->remote_addr->salen);
   
       if ((*new)->sock == INVALID_SOCKET) {
           return apr_get_netos_error();
  @@ -264,7 +264,7 @@
       }
   
       if (connect(sock->sock, (const struct sockaddr *)&sa->sa.sin,
  -                sa->sa_len) == SOCKET_ERROR) {
  +                sa->salen) == SOCKET_ERROR) {
           lasterror = apr_get_netos_error();
           if (lasterror != APR_FROM_OS_ERROR(WSAEWOULDBLOCK)) {
               return lasterror;
  
  
  

Mime
View raw message