/[Apache-SVN]/apr/apr/trunk/network_io/unix/sockets.c
ViewVC logotype

Diff of /apr/apr/trunk/network_io/unix/sockets.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- apr/apr/trunk/network_io/unix/sockets.c	2010/08/09 12:48:58	983617
+++ apr/apr/trunk/network_io/unix/sockets.c	2010/08/09 12:51:29	983618
@@ -387,10 +387,13 @@ apr_status_t apr_socket_connect(apr_sock
         /* A real remote address was passed in.  If the unspecified
          * address was used, the actual remote addr will have to be
          * determined using getpeername() if required. */
-        /* ### this should probably be a structure copy + fixup as per
-         * _accept()'s handling of local_addr */
-        sock->remote_addr = sa;
         sock->remote_addr_unknown = 0;
+
+        /* Copy the address structure details in. */
+        sock->remote_addr->sa = sa->sa;
+        sock->remote_addr->salen = sa->salen;
+        /* Adjust ipaddr_ptr et al. */
+        apr_sockaddr_vars_set(sock->remote_addr, sa->family, sa->port);
     }
 
     if (sock->local_addr->port == 0) {

 

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26