httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r758312 - in /httpd/httpd/trunk: include/mpm_common.h server/mpm/experimental/event/event.c server/mpm/prefork/prefork.c server/mpm/simple/simple_api.c server/mpm/winnt/mpm_winnt.c server/mpm/worker/worker.c server/mpm_common.c
Date Wed, 25 Mar 2009 15:47:02 GMT
Author: trawick
Date: Wed Mar 25 15:46:56 2009
New Revision: 758312

URL: http://svn.apache.org/viewvc?rev=758312&view=rev
Log:
resurrect the old (pre-r757867) compiled-in MPM_NAME value, but via a hook for dynamically
linked MPMs

Modified:
    httpd/httpd/trunk/include/mpm_common.h
    httpd/httpd/trunk/server/mpm/experimental/event/event.c
    httpd/httpd/trunk/server/mpm/prefork/prefork.c
    httpd/httpd/trunk/server/mpm/simple/simple_api.c
    httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c
    httpd/httpd/trunk/server/mpm/worker/worker.c
    httpd/httpd/trunk/server/mpm_common.c

Modified: httpd/httpd/trunk/include/mpm_common.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/include/mpm_common.h?rev=758312&r1=758311&r2=758312&view=diff
==============================================================================
--- httpd/httpd/trunk/include/mpm_common.h (original)
+++ httpd/httpd/trunk/include/mpm_common.h Wed Mar 25 15:46:56 2009
@@ -391,6 +391,9 @@
 AP_DECLARE_HOOK(apr_status_t, mpm_register_timed_callback,
                 (apr_time_t t, ap_mpm_callback_fn_t *cbfn, void *baton))
 
+/* get MPM name */
+AP_DECLARE_HOOK(const char *,mpm_get_name,(void))
+
 #ifdef __cplusplus
 }
 #endif

Modified: httpd/httpd/trunk/server/mpm/experimental/event/event.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/experimental/event/event.c?rev=758312&r1=758311&r2=758312&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/experimental/event/event.c (original)
+++ httpd/httpd/trunk/server/mpm/experimental/event/event.c Wed Mar 25 15:46:56 2009
@@ -394,6 +394,11 @@
     return APR_SUCCESS;
 }
 
+static const char *event_get_name(void)
+{
+    return "event";
+}
+
 /* a clean exit from a child with proper cleanup */
 static void clean_child_exit(int code) __attribute__ ((noreturn));
 static void clean_child_exit(int code)
@@ -2667,6 +2672,7 @@
     ap_hook_mpm_note_child_killed(event_note_child_killed, NULL, NULL, APR_HOOK_MIDDLE);
     ap_hook_mpm_register_timed_callback(event_register_timed_callback, NULL, NULL,
                                         APR_HOOK_MIDDLE);
+    ap_hook_mpm_get_name(event_get_name, NULL, NULL, APR_HOOK_MIDDLE);
 }
 
 static const char *set_daemons_to_start(cmd_parms *cmd, void *dummy,

Modified: httpd/httpd/trunk/server/mpm/prefork/prefork.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/prefork/prefork.c?rev=758312&r1=758311&r2=758312&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/prefork/prefork.c (original)
+++ httpd/httpd/trunk/server/mpm/prefork/prefork.c Wed Mar 25 15:46:56 2009
@@ -316,6 +316,11 @@
     return APR_SUCCESS;
 }
 
+static const char *prefork_get_name(void)
+{
+    return "prefork";
+}
+
 /*****************************************************************
  * Connection structures and accounting...
  */
@@ -1494,6 +1499,7 @@
     ap_hook_mpm_query(prefork_query, NULL, NULL, APR_HOOK_MIDDLE);
     ap_hook_mpm_get_child_pid(prefork_get_child_pid, NULL, NULL, APR_HOOK_MIDDLE);
     ap_hook_mpm_note_child_killed(prefork_note_child_killed, NULL, NULL, APR_HOOK_MIDDLE);
+    ap_hook_mpm_get_name(prefork_get_name, NULL, NULL, APR_HOOK_MIDDLE);
 }
 
 static const char *set_daemons_to_start(cmd_parms *cmd, void *dummy, const char *arg)

Modified: httpd/httpd/trunk/server/mpm/simple/simple_api.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/simple/simple_api.c?rev=758312&r1=758311&r2=758312&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/simple/simple_api.c (original)
+++ httpd/httpd/trunk/server/mpm/simple/simple_api.c Wed Mar 25 15:46:56 2009
@@ -108,6 +108,12 @@
     return APR_ENOTIMPL;
 }
 
+static const char *
+simple_get_name(void)
+{
+    return "simple";
+}
+
 static int
 simple_open_logs(apr_pool_t * p,
                  apr_pool_t * plog, apr_pool_t * ptemp, server_rec * s)
@@ -226,6 +232,8 @@
     ap_hook_mpm(simple_run, NULL, NULL, APR_HOOK_MIDDLE);
 
     ap_hook_mpm_query(simple_query, NULL, NULL, APR_HOOK_MIDDLE);
+
+    ap_hook_mpm_get_name(simple_get_name, NULL, NULL, APR_HOOK_MIDDLE);
 }
 
 static const char *set_proccount(cmd_parms * cmd, void *baton,

Modified: httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c?rev=758312&r1=758311&r2=758312&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c (original)
+++ httpd/httpd/trunk/server/mpm/winnt/mpm_winnt.c Wed Mar 25 15:46:56 2009
@@ -942,6 +942,11 @@
     return APR_ENOTIMPL;
 }
 
+static const char *winnt_get_name(void)
+{
+    return "WinNT";
+}
+
 #define SERVICE_UNSET (-1)
 static apr_status_t service_set = SERVICE_UNSET;
 static apr_status_t service_to_start_success;
@@ -1727,6 +1732,7 @@
     ap_hook_open_logs(winnt_open_logs, NULL, aszSucc, APR_HOOK_REALLY_FIRST);
     ap_hook_mpm(winnt_run, NULL, NULL, APR_HOOK_MIDDLE);
     ap_hook_mpm_query(winnt_query, NULL, NULL, APR_HOOK_MIDDLE);
+    ap_hook_mpm_get_name(winnt_get_name, NULL, NULL, APR_HOOK_MIDDLE);
 }
 
 AP_MODULE_DECLARE_DATA module mpm_winnt_module = {

Modified: httpd/httpd/trunk/server/mpm/worker/worker.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/worker/worker.c?rev=758312&r1=758311&r2=758312&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm/worker/worker.c (original)
+++ httpd/httpd/trunk/server/mpm/worker/worker.c Wed Mar 25 15:46:56 2009
@@ -365,6 +365,11 @@
     return APR_SUCCESS;
 }
 
+static const char *worker_get_name(void)
+{
+    return "worker";
+}
+
 /* a clean exit from a child with proper cleanup */
 static void clean_child_exit(int code) __attribute__ ((noreturn));
 static void clean_child_exit(int code)
@@ -2246,6 +2251,7 @@
     ap_hook_mpm_query(worker_query, NULL, NULL, APR_HOOK_MIDDLE);
     ap_hook_mpm_get_child_pid(worker_get_child_pid, NULL, NULL, APR_HOOK_MIDDLE);
     ap_hook_mpm_note_child_killed(worker_note_child_killed, NULL, NULL, APR_HOOK_MIDDLE);
+    ap_hook_mpm_get_name(worker_get_name, NULL, NULL, APR_HOOK_MIDDLE);
 }
 
 static const char *set_daemons_to_start(cmd_parms *cmd, void *dummy,

Modified: httpd/httpd/trunk/server/mpm_common.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm_common.c?rev=758312&r1=758311&r2=758312&view=diff
==============================================================================
--- httpd/httpd/trunk/server/mpm_common.c (original)
+++ httpd/httpd/trunk/server/mpm_common.c Wed Mar 25 15:46:56 2009
@@ -68,6 +68,7 @@
     APR_HOOK_LINK(mpm_get_child_pid)
     APR_HOOK_LINK(mpm_note_child_killed)
     APR_HOOK_LINK(mpm_register_timed_callback)
+    APR_HOOK_LINK(mpm_get_name)
 )
 AP_IMPLEMENT_HOOK_RUN_ALL(int, fatal_exception,
                           (ap_exception_info_t *ei), (ei), OK, DECLINED)
@@ -80,6 +81,7 @@
     APR_HOOK_LINK(mpm_get_child_pid)
     APR_HOOK_LINK(mpm_note_child_killed)
     APR_HOOK_LINK(mpm_register_timed_callback)
+    APR_HOOK_LINK(mpm_get_name)
 )
 #endif
 AP_IMPLEMENT_HOOK_RUN_ALL(int, monitor,
@@ -102,6 +104,9 @@
 AP_IMPLEMENT_HOOK_RUN_FIRST(apr_status_t, mpm_register_timed_callback,
                             (apr_time_t t, ap_mpm_callback_fn_t *cbfn, void *baton),
                             (t, cbfn, baton), APR_ENOTIMPL)
+AP_IMPLEMENT_HOOK_RUN_FIRST(const char *, mpm_get_name,
+                            (void),
+                            (), "")
 
 /* XXX
  * need better concept for controlling generation of MPM helper functions
@@ -1362,6 +1367,5 @@
 
 AP_DECLARE(const char *)ap_show_mpm(void)
 {
-    /* XXX hook this */
-    return "(unknown)";
+    return ap_run_mpm_get_name();
 }



Mime
View raw message