apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject svn commit: r447894 - /apr/apr/trunk/network_io/unix/sockets.c
Date Tue, 19 Sep 2006 16:11:08 GMT
Author: jorton
Date: Tue Sep 19 09:11:07 2006
New Revision: 447894

URL: http://svn.apache.org/viewvc?view=rev&rev=447894
Log:
* network_io/unix/sockets.c (apr_socket_accept): Fix remote_addr
handling; just use the "struct sockaddr" + length from the
apr_sockaddr_t on the stack, copy them into the ->remote_addr set up
by alloc_socket().

Modified:
    apr/apr/trunk/network_io/unix/sockets.c

Modified: apr/apr/trunk/network_io/unix/sockets.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/network_io/unix/sockets.c?view=diff&rev=447894&r1=447893&r2=447894
==============================================================================
--- apr/apr/trunk/network_io/unix/sockets.c (original)
+++ apr/apr/trunk/network_io/unix/sockets.c Tue Sep 19 09:11:07 2006
@@ -179,9 +179,8 @@
     int s;
     apr_sockaddr_t sa;
 
-    memset(&sa, 0, sizeof(apr_sockaddr_t));
-    apr_sockaddr_vars_set(&sa, sock->local_addr->sa.sin.sin_family, 0);
-    sa.pool = connection_context;
+    sa.salen = sizeof(sa.sa);
+
     s = accept(sock->socketdes, (struct sockaddr *)&sa.sa, &sa.salen);
 
     if (s < 0) {
@@ -204,7 +203,10 @@
     (*new)->remote_addr_unknown = 0;
 
     (*new)->socketdes = s;
-    *(*new)->remote_addr = sa;
+
+    /* Copy in peer's address. */
+    (*new)->remote_addr->sa = sa.sa;
+    (*new)->remote_addr->salen = sa.salen;
 
     *(*new)->local_addr = *sock->local_addr;
 



Mime
View raw message