]> granicus.if.org Git - apache/commitdiff
Win32: Move the call to fetch the network addresses into the accept loop
authorBill Stoddard <stoddard@apache.org>
Tue, 20 Nov 2001 21:34:18 +0000 (21:34 +0000)
committerBill Stoddard <stoddard@apache.org>
Tue, 20 Nov 2001 21:34:18 +0000 (21:34 +0000)
and out of the worker threads. This makes it a bit easier to implement
accept loop processing in modules outside the MPM.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92058 13f79535-47bb-0310-9956-ffa450edef68

server/mpm/winnt/mpm_winnt.c

index c5973ad7ede8e6448e03951efa9a26277fa8204a..3552852c3993358423baa4c3d57e1fc86aa9495d 100644 (file)
@@ -781,13 +781,23 @@ static void winnt_accept(void *listen_socket)
                          "setsockopt(SO_UPDATE_ACCEPT_CONTEXT) failed.");
             /* Not a failure condition. Keep running. */
         }
+
+        /* Get the local & remote address */
+        GetAcceptExSockaddrs(pCompContext->buff,
+                             0,
+                             PADDED_ADDR_SIZE,
+                             PADDED_ADDR_SIZE,
+                             &pCompContext->sa_server,
+                             &pCompContext->sa_server_len,
+                             &pCompContext->sa_client,
+                             &pCompContext->sa_client_len);
+
         /* When a connection is received, send an io completion notification to
          * the ThreadDispatchIOCP. This function could be replaced by
          * mpm_post_completion_context(), but why do an extra function call...
          */
         PostQueuedCompletionStatus(ThreadDispatchIOCP, 0, IOCP_CONNECTION_ACCEPTED,
                                    &pCompContext->Overlapped);
-
     }
 
     if (!shutdown_in_progress) {
@@ -840,18 +850,7 @@ static PCOMP_CONTEXT winnt_get_connection(PCOMP_CONTEXT pCompContext)
                      "Child %d: apr_pool_create failed with rc %d", my_pid, rc);
     }
 
-    /* Get the local & remote address */
-    GetAcceptExSockaddrs(pCompContext->buff,
-                         0,
-                         PADDED_ADDR_SIZE,
-                         PADDED_ADDR_SIZE,
-                         &pCompContext->sa_server,
-                         &pCompContext->sa_server_len,
-                         &pCompContext->sa_client,
-                         &pCompContext->sa_client_len);
-
     return pCompContext;
-
 }
 
 /*