httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pque...@apache.org
Subject svn commit: r722397 - /httpd/httpd/trunk/modules/cluster/mod_heartmonitor.c
Date Tue, 02 Dec 2008 08:10:50 GMT
Author: pquerna
Date: Tue Dec  2 00:10:49 2008
New Revision: 722397

URL: http://svn.apache.org/viewvc?rev=722397&view=rev
Log:
When not configured, don't do anything by default.

Modified:
    httpd/httpd/trunk/modules/cluster/mod_heartmonitor.c

Modified: httpd/httpd/trunk/modules/cluster/mod_heartmonitor.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/cluster/mod_heartmonitor.c?rev=722397&r1=722396&r2=722397&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/cluster/mod_heartmonitor.c (original)
+++ httpd/httpd/trunk/modules/cluster/mod_heartmonitor.c Tue Dec  2 00:10:49 2008
@@ -407,6 +407,10 @@
     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 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 @@
         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);
 



Mime
View raw message