diff --git a/network_io/win32/sockets.c b/network_io/win32/sockets.c index 5013bba88d..b44cd5122e 100644 --- a/network_io/win32/sockets.c +++ b/network_io/win32/sockets.c @@ -414,7 +414,10 @@ APR_DECLARE(apr_status_t) apr_socket_connect(apr_socket_t *sock, sock->remote_addr_unknown = 0; /* Copy the address structure details in. */ - sock->remote_addr = sa; + 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->sa.sin.sin_port == 0) { diff --git a/test/testsock.c b/test/testsock.c index 5c571d6678..7352ab5cae 100644 --- a/test/testsock.c +++ b/test/testsock.c @@ -420,17 +420,17 @@ static void test_get_addr(abts_case *tc, void *data) APR_ASSERT_SUCCESS(tc, "create client socket", rv); APR_ASSERT_SUCCESS(tc, "enable non-block mode", - apr_socket_opt_set(cd, APR_SO_NONBLOCK, 1)); + apr_socket_timeout_set(cd, 0)); - /* It is valid for a connect() on a socket with NONBLOCK set to - * succeed (if the connection can be established synchronously), - * but if it does, this test cannot proceed. */ + /* It is valid for a connect() on a non-blocking socket to succeed + * (if the connection can be established synchronously), but if it + * does, this test cannot proceed. */ rv = apr_socket_connect(cd, sa); if (rv == APR_SUCCESS) { apr_socket_close(ld); apr_socket_close(cd); - ABTS_NOT_IMPL(tc, "Cannot test if connect completes " - "synchronously"); + ABTS_SKIP(tc, data, "Cannot test if connect() completes " + "synchronously"); return; }