]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
merge WinNT MPM support for mpm state query from 2.1-dev
authorJeff Trawick <trawick@apache.org>
Sun, 29 Feb 2004 14:53:01 +0000 (14:53 +0000)
committerJeff Trawick <trawick@apache.org>
Sun, 29 Feb 2004 14:53:01 +0000 (14:53 +0000)
Submitted by: trawick, stoddard
Reviewed by: trawick, stoddard, ake

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/APACHE_2_0_BRANCH@102825 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
server/mpm/winnt/child.c
server/mpm/winnt/mpm_winnt.c
server/mpm/winnt/mpm_winnt.h

diff --git a/CHANGES b/CHANGES
index adf65d451827eb0c4806f7af38ec525b338a73f7..3345660c93652fdce33a8aac31a5c866811e10a5 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -132,8 +132,8 @@ Changes with Apache 2.0.49
      [Tomasz Kepczynski <tomek jot23.org>]
 
   *) Add AP_MPMQ_MPM_STATE function code for ap_mpm_query. (Not yet
-     supported for BeOS, OS/2, or Win32 MPMs.)  [Jeff Trawick,
-     Brad Nicholes]
+     supported for BeOS or OS/2 MPMs.)  [Jeff Trawick, Brad Nicholes,
+     Bill Stoddard]
 
   *) Add mod_status hook to allow modules to add to the mod_status
      report.  [Joe Orton]
diff --git a/STATUS b/STATUS
index f88128ea7af26a9bb6db5173853f2956785ed266..b92dbc179f053e4189905e8d72d51e64bab69505 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -1,5 +1,5 @@
 APACHE 2.0 STATUS:                                              -*-text-*-
-Last modified at [$Date: 2004/02/29 14:13:16 $]
+Last modified at [$Date: 2004/02/29 14:53:00 $]
 
 Release:
 
@@ -184,15 +184,6 @@ PATCHES TO BACKPORT FROM 2.1
                  shows breakage on Solaris which can't -lcrypto -lssl without
                  the extra pkgconfig/openssl.pc Libs: * foo }
 
-    * PREREQ for another fix (stranded piped logger processes) - 
-      ap_mpm_query(AP_MPMQ_MPM_STATE)
-      No updates are available at present for the BeOS or OS/2 MPMs,
-      but that is not a showstopper for the other changes.
-        server/mpm/winnt/mpm_winnt.c r1.303, r1.306
-        server/mpm/winnt/mpm_winnt.h r1.44
-        server/mpm/winnt/child.c r1.21
-      +1: trawick, stoddard, ake
-
     * piped log programs respawning after Apache is stopped. PR 24805
       bogus "piped log program '(null)' failed" messages during
       restart. PR 21648.  Two people have tested a similar log.c patch
index 47c9703df73d899c69769568a7a554b9d9786dc7..1859156e7f67cc78dc657234fbcaa89f1db182f6 100644 (file)
@@ -49,7 +49,6 @@ HANDLE exit_event;
 /* child_main() should never need to modify is_graceful!?! */
 extern int volatile is_graceful;
 
-
 /* Queue for managing the passing of COMP_CONTEXTs between
  * the accept and worker threads.
  */
@@ -866,6 +865,7 @@ void child_main(apr_pool_t *pconf)
         if (!listener_started && threads_created) {
             create_listener_thread();
             listener_started = 1;
+            winnt_mpm_state = AP_MPMQ_RUNNING;
         }
         if (threads_created == ap_threads_per_child) {
             break;
@@ -944,6 +944,8 @@ void child_main(apr_pool_t *pconf)
      */
 
  shutdown:
+
+    winnt_mpm_state = AP_MPMQ_STOPPING;
     /* Setting is_graceful will cause threads handling keep-alive connections 
      * to close the connection after handling the current request.
      */
index 8d5ce7b9cc27218104c61865d8ddfbb99c9f3c66..2cfde3fe53bead28290e89a28e093048dbc3caa8 100644 (file)
@@ -64,6 +64,7 @@ int use_acceptex = 1;
 static int thread_limit = DEFAULT_THREAD_LIMIT;
 static int first_thread_limit = 0;
 static int changed_limit_at_restart;
+int winnt_mpm_state = AP_MPMQ_STARTING;
 
 /* ap_my_generation are used by the scoreboard code */
 ap_generation_t volatile ap_my_generation=0;
@@ -885,6 +886,7 @@ static int master_main(server_rec *s, HANDLE shutdown_event, HANDLE restart_even
     ap_scoreboard_image->parent[0].pid = child_pid;
 
     /* Wait for shutdown or restart events or for child death */
+    winnt_mpm_state = AP_MPMQ_RUNNING;
     rv = WaitForMultipleObjects(NUM_WAIT_HANDLES, (HANDLE *) event_handles, FALSE, INFINITE);
     cld = rv - WAIT_OBJECT_0;
     if (rv == WAIT_FAILED) {
@@ -964,6 +966,7 @@ die_now:
     if (shutdown_pending) 
     {
         int timeout = 30000;  /* Timeout is milliseconds */
+        winnt_mpm_state = AP_MPMQ_STOPPING;
 
         /* This shutdown is only marginally graceful. We will give the 
          * child a bit of time to exit gracefully. If the time expires,
@@ -995,7 +998,7 @@ die_now:
         }
         return 0;  /* Tell the caller we do not want to restart */
     }
-
+    winnt_mpm_state = AP_MPMQ_STARTING;
     return 1;      /* Tell the caller we want a restart */
 }
 
@@ -1048,6 +1051,9 @@ AP_DECLARE(apr_status_t) ap_mpm_query(int query_code, int *result)
         case AP_MPMQ_MAX_DAEMONS:
             *result = 0;
             return APR_SUCCESS;
+        case AP_MPMQ_MPM_STATE:
+            *result = winnt_mpm_state;
+            return APR_SUCCESS;
     }
     return APR_ENOTIMPL;
 } 
index 3b7eddde5dfc14146a171c9e213bc456f8a91d07..66d56d5e3804740633cde9b4f4d9bf861fe14247 100644 (file)
@@ -58,6 +58,7 @@ void mpm_nt_eventlog_stderr_flush(void);
 
 /* From winnt.c: */
 extern int use_acceptex;
+extern int winnt_mpm_state;
 extern OSVERSIONINFO osver;
 extern void clean_child_exit(int);