this came up on test-dev@ a while ago. while we haven't quite fully settled on an interface to Apache-Test yet, I thought to post this patch here, since it implements some XXX comments in core. the output for the prefork and worker builds I have look like

Server version: Apache/2.1.0-dev
Server built:   Aug 12 2003 02:25:22
Server's Module Magic Number: 20030213:1
Architecture:   32-bit
Server MPM:     Prefork
  threaded:     no
    forked:     yes (dynamic)
Server compiled with....

Server version: Apache/2.1.0-dev
Server built:   Aug 12 2003 02:28:54
Server's Module Magic Number: 20030213:1
Architecture:   32-bit
Server MPM:     Worker
  threaded:     yes (static)
    forked:     yes (dynamic)
Server compiled with....


--Geoff



Index: server/main.c =================================================================== RCS file: /home/cvspublic/httpd-2.0/server/main.c,v retrieving revision 1.144 diff -u -r1.144 main.c --- server/main.c 22 Feb 2003 14:32:39 -0000 1.144 +++ server/main.c 13 Aug 2003 14:27:59 -0000 @@ -85,7 +85,40 @@ * Most significant main() global data can be found in http_config.c */

-/* XXX - We should be able to grab the per-MPM settings here too */
+static void show_mpm_settings(void)
+{
+    int mpm_query_info;
+
+    printf("Server MPM:     %s\n", ap_show_mpm());
+
+    ap_mpm_query(AP_MPMQ_IS_THREADED, &mpm_query_info);
+
+    printf("  threaded:     ");
+
+    if (mpm_query_info == AP_MPMQ_DYNAMIC) {
+        printf("yes (dynamic)\n");
+    }
+    else if (mpm_query_info == AP_MPMQ_STATIC) {
+        printf("yes (static)\n");
+    }
+    else {
+        printf("no\n");
+    }
+
+    ap_mpm_query(AP_MPMQ_IS_FORKED, &mpm_query_info);
+    printf("    forked:     ");
+
+    if (mpm_query_info == AP_MPMQ_DYNAMIC) {
+        printf("yes (dynamic)\n");
+    }
+    else if (mpm_query_info == AP_MPMQ_STATIC) {
+        printf("yes (static)\n");
+    }
+    else {
+        printf("no\n");
+    }
+}
+
 static void show_compile_settings(void)
 {
     printf("Server version: %s\n", ap_get_server_version());
@@ -98,6 +131,9 @@
      * consistent
      */
     printf("Architecture:   %ld-bit\n", 8 * (long)sizeof(void *));
+
+    show_mpm_settings();
+
     printf("Server compiled with....\n");
 #ifdef BIG_SECURITY_HOLE
     printf(" -D BIG_SECURITY_HOLE\n");



Reply via email to