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
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)
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,
return APR_SUCCESS;
}
+static const char *prefork_get_name(void)
+{
+ return "prefork";
+}
+
/*****************************************************************
* Connection structures and accounting...
*/
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)
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)
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,
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;
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 = {
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)
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,
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)
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,
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
AP_DECLARE(const char *)ap_show_mpm(void)
{
- /* XXX hook this */
- return "(unknown)";
+ return ap_run_mpm_get_name();
}