--- sockets.c	Wed Dec 19 14:55:41 2001
+++ d:\tempapache\apr\network_io\win32\sockets.c	Tue Dec 11 09:24:02 2001
@@ -226,26 +226,20 @@
 APR_DECLARE(apr_status_t) apr_accept(apr_socket_t **new, apr_socket_t *sock,
                                      apr_pool_t *p)
 {
-    SOCKET s;
-    struct sockaddr sa;
-    int salen = sizeof(sock->remote_addr->sa);
-
-    // Don't allocate the memory until after we call accept. This allows
-    //  us to work with nonblocking sockets.
-    s = accept(sock->sock, (struct sockaddr *)&sa, &salen);
-    if (s == INVALID_SOCKET) {
-        return apr_get_netos_error();
-    }
-
     alloc_socket(new, p);
     set_socket_vars(*new, sock->local_addr->sa.sin.sin_family, SOCK_STREAM);
 
     (*new)->timeout = -1;   
     (*new)->disconnected = 0;
 
-    (*new)->sock = s;
     (*new)->remote_addr->salen = sizeof((*new)->remote_addr->sa);
-    memcpy (&(*new)->remote_addr->sa, &sa, salen);
+    (*new)->sock = accept(sock->sock, 
+                          (struct sockaddr *)&(*new)->remote_addr->sa,
+                          &(*new)->remote_addr->salen);
+
+    if ((*new)->sock == INVALID_SOCKET) {
+        return apr_get_netos_error();
+    }
     *(*new)->local_addr = *sock->local_addr;
 
     /* The above assignment just overwrote the pool entry. Setting the local_addr 

