From: Bill Stoddard Date: Fri, 9 Jan 2004 02:22:45 +0000 (+0000) Subject: Win32: plug a socket handle leak on Win9x and when using Win32DisableAcceptex on NT X-Git-Tag: pre_ajp_proxy~847 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f99e12ed32d70d7c4289dbac89505145a7667f84;p=apache Win32: plug a socket handle leak on Win9x and when using Win32DisableAcceptex on NT git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102238 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/mpm/winnt/child.c b/server/mpm/winnt/child.c index 7f6e556c88..5b0aaa181a 100644 --- a/server/mpm/winnt/child.c +++ b/server/mpm/winnt/child.c @@ -767,6 +767,16 @@ static void worker_main(long thread_num) context->accept_socket = INVALID_SOCKET; ap_lingering_close(c); } + else if (!use_acceptex) { + /* If the socket is disconnected but we are not using acceptex, + * we cannot reuse the socket. Disconnected sockets are removed + * from the apr_socket_t struct by apr_sendfile() to prevent the + * socket descriptor from being inadvertently closed by a call + * to apr_socket_close(), so close it directly. + */ + closesocket(context->accept_socket); + context->accept_socket = INVALID_SOCKET; + } } else { /* ap_run_create_connection closes the socket on failure */