From: Bill Stoddard Date: Tue, 13 Feb 2001 22:11:13 +0000 (+0000) Subject: Windows MPM: Handle ap_new_connection() failure. X-Git-Tag: 2.0.11~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=63c7a2e0370207ae0725babea82ad950688c22df;p=apache Windows MPM: Handle ap_new_connection() failure. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@88148 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/mpm/winnt/mpm_winnt.c b/server/mpm/winnt/mpm_winnt.c index 952ee3e0cd..8febaed81f 100644 --- a/server/mpm/winnt/mpm_winnt.c +++ b/server/mpm/winnt/mpm_winnt.c @@ -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); } }