File apache2-mpm-winnt-add-running-the-child_stopping-hook.patch of Package apache2.35278

From 7c72b58416b660648d5516c0743eae8bd2840692 Mon Sep 17 00:00:00 2001
From: Stefan Eissing <icing@apache.org>
Date: Tue, 22 Feb 2022 11:32:29 +0000
Subject: [PATCH]   *) 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
---
 server/mpm/winnt/child.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/server/mpm/winnt/child.c b/server/mpm/winnt/child.c
index 6f5dbecd83..ae69f83304 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)
      */
     shutdown_in_progress = 1;
 
+    /* Notify anyone interested that this child is stopping.
+     */
+    ap_run_child_stopping(pchild, graceful_shutdown);
+
     Sleep(1000);
 
     /* Tell the worker threads to exit */
-- 
2.41.0

openSUSE Build Service is sponsored by