Return-Path: Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 18517 invoked by uid 500); 24 May 2002 16:58:24 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 18506 invoked by uid 500); 24 May 2002 16:58:24 -0000 Delivered-To: apmail-httpd-2.0-cvs@apache.org Date: 24 May 2002 16:58:23 -0000 Message-ID: <20020524165823.12959.qmail@icarus.apache.org> From: stoddard@apache.org To: httpd-2.0-cvs@apache.org Subject: cvs commit: httpd-2.0/server/mpm/winnt mpm_winnt.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N stoddard 02/05/24 09:58:23 Modified: server/mpm/winnt mpm_winnt.c Log: Win32: Shutdown the listeners before telling the accept threads to quit. Revision Changes Path 1.276 +12 -8 httpd-2.0/server/mpm/winnt/mpm_winnt.c Index: mpm_winnt.c =================================================================== RCS file: /home/cvs/httpd-2.0/server/mpm/winnt/mpm_winnt.c,v retrieving revision 1.275 retrieving revision 1.276 diff -u -r1.275 -r1.276 --- mpm_winnt.c 24 May 2002 16:56:39 -0000 1.275 +++ mpm_winnt.c 24 May 2002 16:58:23 -0000 1.276 @@ -1362,21 +1362,25 @@ */ shutdown: - /* Setting is_graceful will cause keep-alive connections to be closed - * rather than block on the next network read. + /* Setting is_graceful will cause threads handling keep-alive connections + * to close the connection after handling the current request. */ is_graceful = 1; - /* Setting shutdown_in_progress prevents new connections from - * being accepted but allows the worker threads to continue - * handling connections that have already been accepted. + /* Close the listening sockets. Note, we must close the listeners + * before closing any accept sockets pending in AcceptEx to prevent + * memory leaks in the kernel. */ - shutdown_in_progress = 1; - - /* Close the listening sockets. */ for (lr = ap_listeners; lr ; lr = lr->next) { apr_socket_close(lr->sd); } + + /* Shutdown listener threads and pending AcceptEx socksts + * but allow the worker threads to continue consuming from + * the queue of accepted connections. + */ + shutdown_in_progress = 1; + Sleep(1000); /* Tell the worker threads to exit */