]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
*) mpm/winnt: add running the 'child_stopping' hook.
authorStefan Eissing <icing@apache.org>
Tue, 22 Feb 2022 11:32:29 +0000 (11:32 +0000)
committerStefan Eissing <icing@apache.org>
Tue, 22 Feb 2022 11:32:29 +0000 (11:32 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1898317 13f79535-47bb-0310-9956-ffa450edef68

server/mpm/winnt/child.c

index 6f5dbecd839a118e47526349f79d917fc65416eb..ae69f83304288807bf709efb48f90276fd5af51b 100644 (file)
@@ -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 */