summaryrefslogtreecommitdiffstats
path: root/modules/cluster
diff options
context:
space:
mode:
authorJeff Trawick <trawick@apache.org>2009-09-30 22:00:37 +0200
committerJeff Trawick <trawick@apache.org>2009-09-30 22:00:37 +0200
commite054fa7183a07f7ef3eb6e1cbc20aa3bbffda629 (patch)
treeec9993aab12e69c5f6afbe1608a8d85234093acf /modules/cluster
parentdon't override the user's choice (e.g., --enable-watchdog) (diff)
downloadapache2-e054fa7183a07f7ef3eb6e1cbc20aa3bbffda629.tar.xz
apache2-e054fa7183a07f7ef3eb6e1cbc20aa3bbffda629.zip
change the callable functions in the mod_watchdog API
to optional hooks to avoid module ordering or other symbol resolution issues; affected: ap_watchdog_get_instance ap_watchdog_register_callback ap_watchdog_set_callback_interval git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@820427 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/cluster')
-rw-r--r--modules/cluster/mod_heartmonitor.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/modules/cluster/mod_heartmonitor.c b/modules/cluster/mod_heartmonitor.c
index 452c63c801..9933ca77de 100644
--- a/modules/cluster/mod_heartmonitor.c
+++ b/modules/cluster/mod_heartmonitor.c
@@ -669,7 +669,16 @@ static int hm_post_config(apr_pool_t *p, apr_pool_t *plog,
void *data;
hm_ctx_t *ctx = ap_get_module_config(s->module_config,
&heartmonitor_module);
-
+ APR_OPTIONAL_FN_TYPE(ap_watchdog_get_instance) *hm_watchdog_get_instance;
+ APR_OPTIONAL_FN_TYPE(ap_watchdog_register_callback) *hm_watchdog_register_callback;
+
+ hm_watchdog_get_instance = APR_RETRIEVE_OPTIONAL_FN(ap_watchdog_get_instance);
+ hm_watchdog_register_callback = APR_RETRIEVE_OPTIONAL_FN(ap_watchdog_register_callback);
+ if (!hm_watchdog_get_instance || !hm_watchdog_register_callback) {
+ ap_log_error(APLOG_MARK, APLOG_CRIT, 0, s,
+ "Heartmonitor: mod_watchdog is required");
+ return !OK;
+ }
/* Create the slotmem */
apr_pool_userdata_get(&data, userdata_key, s->process->pool);
@@ -694,7 +703,7 @@ static int hm_post_config(apr_pool_t *p, apr_pool_t *plog,
if (!ctx->active) {
return OK;
}
- rv = ap_watchdog_get_instance(&ctx->watchdog,
+ rv = hm_watchdog_get_instance(&ctx->watchdog,
HM_WATHCHDOG_NAME,
0, 1, p);
if (rv) {
@@ -704,7 +713,7 @@ static int hm_post_config(apr_pool_t *p, apr_pool_t *plog,
return !OK;
}
/* Register a callback with zero interval. */
- rv = ap_watchdog_register_callback(ctx->watchdog,
+ rv = hm_watchdog_register_callback(ctx->watchdog,
0,
ctx,
hm_watchdog_callback);