]> granicus.if.org Git - apache/commitdiff
Windows MPM: Handle ap_new_connection() failure.
authorBill Stoddard <stoddard@apache.org>
Tue, 13 Feb 2001 22:11:13 +0000 (22:11 +0000)
committerBill Stoddard <stoddard@apache.org>
Tue, 13 Feb 2001 22:11:13 +0000 (22:11 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88148 13f79535-47bb-0310-9956-ffa450edef68

server/mpm/winnt/mpm_winnt.c

index 952ee3e0cdd9fbaf0ed2f760a03d32c4a8a03819..8febaed81f93677c06a19bf43328dff34e9c6b31 100644 (file)
@@ -1164,14 +1164,17 @@ static void worker_main(int thread_num)
 
         c = ap_new_connection(context->ptrans, server_conf, context->sock,
                               thread_num);
-
-        ap_process_connection(c);
-
-
-        apr_getsocketopt(context->sock, APR_SO_DISCONNECTED, &disconnected);
-        if (!disconnected) {
+        if (c) {
+            ap_process_connection(c);
+            apr_getsocketopt(context->sock, APR_SO_DISCONNECTED, &disconnected);
+            if (!disconnected) {
+                context->accept_socket = INVALID_SOCKET;
+                ap_lingering_close(c);
+            }
+        }
+        else {
+            /* ap_new_connection closes the socket on failure */
             context->accept_socket = INVALID_SOCKET;
-            ap_lingering_close(c);
         }
     }