From: Paul Querna Date: Tue, 2 Dec 2008 08:10:49 +0000 (+0000) Subject: When not configured, don't do anything by default. X-Git-Tag: 2.3.0~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a9748efa3fcd9a1cd2036116c69326ea4cf97c22;p=thirdparty%2Fapache%2Fhttpd.git When not configured, don't do anything by default. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@722397 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/cluster/mod_heartmonitor.c b/modules/cluster/mod_heartmonitor.c index 5e5b562b9ba..e98b505ec3e 100644 --- a/modules/cluster/mod_heartmonitor.c +++ b/modules/cluster/mod_heartmonitor.c @@ -407,6 +407,10 @@ static void hm_child_init(apr_pool_t *p, server_rec *s) hm_ctx_t *ctx = ap_get_module_config(s->module_config, &heartmonitor_module); + if (!ctx->active) { + return; + } + apr_proc_mutex_child_init(&ctx->mutex, ctx->mutex_path, p); ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, s, @@ -429,10 +433,16 @@ static void hm_child_init(apr_pool_t *p, server_rec *s) static int hm_post_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s) { + apr_status_t rv; hm_ctx_t *ctx = ap_get_module_config(s->module_config, &heartmonitor_module); - apr_status_t rv = apr_proc_mutex_create(&ctx->mutex, + + if (!ctx->active) { + return OK; + } + + rv = apr_proc_mutex_create(&ctx->mutex, ctx->mutex_path, #if APR_HAS_FCNTL_SERIALIZE @@ -510,7 +520,12 @@ static const char *cmd_hm_listen(cmd_parms *cmd, return err; } - ctx->active = 1; + if (!ctx->active) { + ctx->active = 1; + } + else { + return "HeartbeatListen: May only be specified once."; + } rv = apr_parse_addr_port(&host_str, &scope_id, &port, mcast_addr, p);