From: Manoj Kasichainula Date: Wed, 21 Jul 1999 22:32:36 +0000 (+0000) Subject: Fix silly bug. accept() has to be inside the accept mutexed block. doh. X-Git-Tag: 1.3.7~23 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83921a9e40530b2613b6033f07eb61db02239a52;p=thirdparty%2Fapache%2Fhttpd.git Fix silly bug. accept() has to be inside the accept mutexed block. doh. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@83481 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/mpm/mpmt_pthread/mpmt_pthread.c b/server/mpm/mpmt_pthread/mpmt_pthread.c index 324c70ef6b6..c5cf011a2de 100644 --- a/server/mpm/mpmt_pthread/mpmt_pthread.c +++ b/server/mpm/mpmt_pthread/mpmt_pthread.c @@ -950,10 +950,16 @@ static void * worker_thread(void * dummy) } } got_fd: - SAFE_ACCEPT(accept_mutex_off(0)); - SAFE_ACCEPT(intra_mutex_off(0)); - if (workers_may_exit) break; - csd = ap_accept(sd, &sa_client, &len); + if (!workers_may_exit) { + csd = ap_accept(sd, &sa_client, &len); + SAFE_ACCEPT(accept_mutex_off(0)); + SAFE_ACCEPT(intra_mutex_off(0)); + } + else { + SAFE_ACCEPT(accept_mutex_off(0)); + SAFE_ACCEPT(intra_mutex_off(0)); + break; + } process_socket(ptrans, &sa_client, csd, process_slot, thread_slot); ap_clear_pool(ptrans); requests_this_child--;