]> granicus.if.org Git - apache/commitdiff
When not configured, don't do anything by default.
authorPaul Querna <pquerna@apache.org>
Tue, 2 Dec 2008 08:10:49 +0000 (08:10 +0000)
committerPaul Querna <pquerna@apache.org>
Tue, 2 Dec 2008 08:10:49 +0000 (08:10 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@722397 13f79535-47bb-0310-9956-ffa450edef68

modules/cluster/mod_heartmonitor.c

index 5e5b562b9ba62cff1d3dcff0bf9f8152990abf9b..e98b505ec3e422dc8ead91f4774f8d00f5760bd0 100644 (file)
@@ -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);