]> granicus.if.org Git - apache/commitdiff
Don't try to process a connection when accept() failed.
authorJeff Trawick <trawick@apache.org>
Thu, 27 Jul 2000 23:05:44 +0000 (23:05 +0000)
committerJeff Trawick <trawick@apache.org>
Thu, 27 Jul 2000 23:05:44 +0000 (23:05 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85908 13f79535-47bb-0310-9956-ffa450edef68

server/mpm/dexter/dexter.c
server/mpm/mpmt_pthread/mpmt_pthread.c

index dc1c6e58b99ddb199dba6fd68f25262007d1f553..6b1388ec67bef94cb2c1492e375deef94b5b2bba 100644 (file)
@@ -595,6 +595,7 @@ static void *worker_thread(void *arg)
     got_fd:
         if (!workers_may_exit) {
             if ((rv = ap_accept(&csd, sd, ptrans)) != APR_SUCCESS) {
+                csd = NULL;
                 ap_log_error(APLOG_MARK, APLOG_ERR, rv, ap_server_conf, "ap_accept");
             }
             if ((rv = SAFE_ACCEPT(ap_unlock(process_accept_mutex)))
@@ -615,8 +616,10 @@ static void *worker_thread(void *arg)
                 }
             }
             pthread_mutex_unlock(&idle_thread_count_mutex);
-            process_socket(ptrans, csd, conn_id);
-            requests_this_child--;
+            if (csd != NULL) {
+                process_socket(ptrans, csd, conn_id);
+                requests_this_child--;
+            }
        } else {
             if ((rv = SAFE_ACCEPT(ap_unlock(process_accept_mutex)))
                 != APR_SUCCESS) {
index ab5bd976401be41818f81097047285e8dd143f28..0ae5cf28489b91ce83112b858364e13c9373ac65 100644 (file)
@@ -545,6 +545,7 @@ static void * worker_thread(void * dummy)
     got_fd:
         if (!workers_may_exit) {
             if ((rv = ap_accept(&csd, sd, ptrans)) != APR_SUCCESS) {
+                csd = NULL;
                 ap_log_error(APLOG_MARK, APLOG_ERR, rv, ap_server_conf, 
                              "ap_accept");
             }
@@ -556,8 +557,10 @@ static void * worker_thread(void * dummy)
                 workers_may_exit = 1;
             }
             pthread_mutex_unlock(&thread_accept_mutex);
-            process_socket(ptrans, csd, process_slot, thread_slot);
-            requests_this_child--;
+            if (csd != NULL) {
+                process_socket(ptrans, csd, process_slot, thread_slot);
+                requests_this_child--;
+            }
         }
         else {
             if ((rv = SAFE_ACCEPT(ap_unlock(process_accept_mutex)))