You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by st...@apache.org on 2004/01/09 03:22:45 UTC
cvs commit: httpd-2.0/server/mpm/winnt child.c
stoddard 2004/01/08 18:22:45
Modified: server/mpm/winnt child.c
Log:
Win32: plug a socket handle leak on Win9x and when using Win32DisableAcceptex on NT
Revision Changes Path
1.23 +10 -0 httpd-2.0/server/mpm/winnt/child.c
Index: child.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/mpm/winnt/child.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- child.c 1 Jan 2004 13:26:25 -0000 1.22
+++ child.c 9 Jan 2004 02:22:45 -0000 1.23
@@ -767,6 +767,16 @@
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 */