apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <jor...@redhat.com>
Subject Re: svn commit: r442492 - /apr/apr/branches/1.2.x/network_io/unix/sockets.c
Date Wed, 13 Sep 2006 12:30:06 GMT
On Tue, Sep 12, 2006 at 06:59:35AM -0000, Mladen Turk wrote:
> Author: mturk
> Date: Mon Sep 11 23:59:34 2006
> New Revision: 442492
> 
> URL: http://svn.apache.org/viewvc?view=rev&rev=442492
> Log:
> Backport r442135 from trunk.

This has broken the access control tests in httpd-test for both 2.2.x 
and 2.0.x.  I'm seeing random addresses logged in access_log, 0.0.0.0 
and such.  The ->remote_addr changes below look unrelated to the 
original change, and I guess that is what is wrong.
 
> Modified:
>     apr/apr/branches/1.2.x/network_io/unix/sockets.c
> 
> Modified: apr/apr/branches/1.2.x/network_io/unix/sockets.c
> URL: http://svn.apache.org/viewvc/apr/apr/branches/1.2.x/network_io/unix/sockets.c?view=diff&rev=442492&r1=442491&r2=442492
> ==============================================================================
> --- apr/apr/branches/1.2.x/network_io/unix/sockets.c (original)
> +++ apr/apr/branches/1.2.x/network_io/unix/sockets.c Mon Sep 11 23:59:34 2006
> @@ -176,29 +176,34 @@
>  apr_status_t apr_socket_accept(apr_socket_t **new, apr_socket_t *sock,
>                                 apr_pool_t *connection_context)
>  {
> -    alloc_socket(new, connection_context);
> -    set_socket_vars(*new, sock->local_addr->sa.sin.sin_family, SOCK_STREAM, sock->protocol);
> +    int s;
> +    apr_sockaddr_t sa;
>  
> -#ifndef HAVE_POLL
> -    (*new)->connected = 1;
> -#endif
> -    (*new)->timeout = -1;
> -    
> -    (*new)->socketdes = accept(sock->socketdes, 
> -                               (struct sockaddr *)&(*new)->remote_addr->sa,
> -                               &(*new)->remote_addr->salen);
> +    apr_sockaddr_vars_set(&sa, sock->local_addr->sa.sin.sin_family, 0);
> +    sa.pool = connection_context;
> +    s = accept(sock->socketdes, (struct sockaddr *)&sa.sa, &sa.salen);
>  
> -    if ((*new)->socketdes < 0) {
> +    if (s < 0) {
>          return errno;
>      }
>  #ifdef TPF
> -    if ((*new)->socketdes == 0) { 
> +    if (s == 0) { 
>          /* 0 is an invalid socket for TPF */
>          return APR_EINTR;
>      }
>  #endif
> +    alloc_socket(new, connection_context);
> +    set_socket_vars(*new, sock->local_addr->sa.sin.sin_family, SOCK_STREAM, sock->protocol);
> +
> +#ifndef HAVE_POLL
> +    (*new)->connected = 1;
> +#endif
> +    (*new)->timeout = -1;
>  
>      (*new)->remote_addr_unknown = 0;
> +
> +    (*new)->socketdes = s;
> +    *(*new)->remote_addr = sa;
>  
>      *(*new)->local_addr = *sock->local_addr;
>  
> 

Mime
View raw message