]> granicus.if.org Git - apache/commitdiff
As the prior commit message indicated, pass the accept thread a listen
authorWilliam A. Rowe Jr <wrowe@apache.org>
Sat, 18 May 2002 21:43:24 +0000 (21:43 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Sat, 18 May 2002 21:43:24 +0000 (21:43 +0000)
  rec as opposed to simply the listen socket.

  However, the prior commit (which I crossed up with this patch) really
  closed a segfault where we attempted to log messages to ap_server_conf,
  after the server conf was destroyed, and prior to setting the new
  value in the next go-around of post_config.

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

server/mpm/winnt/mpm_winnt.c

index 0f41188e66daf021e0d5fc21d8f7f420f94a1783..f9c7614cefaeead61c2aee376b9b9c3b8b74adf3 100644 (file)
@@ -924,15 +924,16 @@ static PCOMP_CONTEXT win9x_get_connection(PCOMP_CONTEXT context)
  *    Worker threads block on the ThreadDispatch IOCompletionPort awaiting 
  *    connections to service.
  */
-static void winnt_accept(void *listen_socket
+static void winnt_accept(void *lr_
 {
+    ap_listen_rec *lr = (ap_listen_rec *)lr_;
     apr_os_sock_info_t sockinfo;
     PCOMP_CONTEXT context = NULL;
     DWORD BytesRead;
     SOCKET nlsd;
     int rv;
 
-    nlsd = (SOCKET) listen_socket;
+    apr_os_sock_get(&nlsd, lr->sd);
 
     while (!shutdown_in_progress) {
         if (!context) {
@@ -1190,14 +1191,14 @@ static void create_listener_thread()
         _beginthreadex(NULL, 0, (LPTHREAD_START_ROUTINE) win9x_accept,
                        NULL, 0, &tid);
     } else {
-        /* Start an accept thread per listener */
-        SOCKET nlsd; /* native listening sock descriptor */
+        /* Start an accept thread per listener 
+         * XXX: Why would we have a NULL sd in our listeners?
+         */
         ap_listen_rec *lr;
         for (lr = ap_listeners; lr; lr = lr->next) {
             if (lr->sd != NULL) {
-                apr_os_sock_get(&nlsd, lr->sd);
                 _beginthreadex(NULL, 1000, (LPTHREAD_START_ROUTINE) winnt_accept,
-                               (void *) nlsd, 0, &tid);
+                               (void *) lr, 0, &tid);
             }
         }
     }