From: Stefan Eissing Date: Tue, 22 Feb 2022 11:32:29 +0000 (+0000) Subject: *) mpm/winnt: add running the 'child_stopping' hook. X-Git-Tag: 2.5.0-alpha2-ci-test-only~484 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c72b58416b660648d5516c0743eae8bd2840692;p=thirdparty%2Fapache%2Fhttpd.git *) mpm/winnt: add running the 'child_stopping' hook. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898317 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/mpm/winnt/child.c b/server/mpm/winnt/child.c index 6f5dbecd839..ae69f833042 100644 --- a/server/mpm/winnt/child.c +++ b/server/mpm/winnt/child.c @@ -905,6 +905,7 @@ void child_main(apr_pool_t *pconf, DWORD parent_pid) int rv; int i; int num_events; + int graceful_shutdown = 0; /* Get a sub context for global allocations in this child, so that * we can have cleanups occur when the child exits. @@ -1114,6 +1115,7 @@ void child_main(apr_pool_t *pconf, DWORD parent_pid) ap_log_error(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, ap_server_conf, APLOGNO(00357) "Child: Exit event signaled. Child process is " "ending."); + graceful_shutdown = 1; break; } else if (cld == 2) { @@ -1132,6 +1134,7 @@ void child_main(apr_pool_t *pconf, DWORD parent_pid) "MaxConnectionsPerChild. Signaling the parent to " "restart a new child process."); ap_signal_parent(SIGNAL_PARENT_RESTART); + graceful_shutdown = 1; break; } } @@ -1158,6 +1161,10 @@ void child_main(apr_pool_t *pconf, DWORD parent_pid) */ SetEvent(listener_shutdown_event); + /* Notify anyone interested that this child is stopping. + */ + ap_run_child_stopping(pchild, graceful_shutdown); + Sleep(1000); /* Tell the worker threads to exit */