From: Jeff Trawick Date: Thu, 27 Jul 2000 23:05:44 +0000 (+0000) Subject: Don't try to process a connection when accept() failed. X-Git-Tag: APACHE_2_0_ALPHA_5~66 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=307207de74151ff7b140e1b4e201d5353cbf14e4;p=apache Don't try to process a connection when accept() failed. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85908 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/mpm/dexter/dexter.c b/server/mpm/dexter/dexter.c index dc1c6e58b9..6b1388ec67 100644 --- a/server/mpm/dexter/dexter.c +++ b/server/mpm/dexter/dexter.c @@ -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) { diff --git a/server/mpm/mpmt_pthread/mpmt_pthread.c b/server/mpm/mpmt_pthread/mpmt_pthread.c index ab5bd97640..0ae5cf2848 100644 --- a/server/mpm/mpmt_pthread/mpmt_pthread.c +++ b/server/mpm/mpmt_pthread/mpmt_pthread.c @@ -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)))