Author: jfrederic.clere(a)jboss.com
Date: 2008-07-16 08:47:29 -0400 (Wed, 16 Jul 2008)
New Revision: 1754
Modified:
trunk/mod_cluster/native/advertise/mod_advertise.c
Log:
Make sure that any directive sets the conf for the VirtualHost
and prevent having directives in more than one VirtualHost.
Modified: trunk/mod_cluster/native/advertise/mod_advertise.c
===================================================================
--- trunk/mod_cluster/native/advertise/mod_advertise.c 2008-07-16 12:32:34 UTC (rev 1753)
+++ trunk/mod_cluster/native/advertise/mod_advertise.c 2008-07-16 12:47:29 UTC (rev 1754)
@@ -137,6 +137,12 @@
if (ma_advertise_srvs)
return "Duplicate ServerAdvertise directives are not allowed";
+ /* Virtual Host containing the directive */
+ if (ma_server_rec !=NULL && ma_server_rec != cmd->server)
+ return "All Advertise directives must be in the same VirtualHost";
+ if (ma_server_rec == NULL)
+ ma_server_rec = cmd->server;
+
if (strcasecmp(arg, "Off") == 0)
ma_advertise_mode = ma_advertise_off;
else if (strcasecmp(arg, "On") == 0)
@@ -157,7 +163,6 @@
!ma_advertise_srvp)
return "Invalid ServerAdvertise Address";
}
- ma_server_rec = cmd->server; /* Virtual Host containing the directive */
return NULL;
}
@@ -170,6 +175,11 @@
static const char *cmd_advertise_g(cmd_parms *cmd, void *dummy,
const char *arg)
{
+ if (ma_server_rec !=NULL && ma_server_rec != cmd->server)
+ return "All Advertise directives must be in the same VirtualHost";
+ if (ma_server_rec == NULL)
+ ma_server_rec = cmd->server;
+
if (ma_advertise_set)
return "Duplicate AdvertiseGroup directives are not allowed";
@@ -197,6 +207,11 @@
apr_time_t s, u = 0;
const char *p;
+ if (ma_server_rec !=NULL && ma_server_rec != cmd->server)
+ return "All Advertise directives must be in the same VirtualHost";
+ if (ma_server_rec == NULL)
+ ma_server_rec = cmd->server;
+
if (ma_advertise_freq != MA_DEFAULT_ADV_FREQ)
return "Duplicate AdvertiseFrequency directives are not allowed";
if ((p = ap_strchr_c(arg, '.')) || (p = ap_strchr_c(arg, ',')))
@@ -218,6 +233,11 @@
static const char *cmd_advertise_k(cmd_parms *cmd, void *dummy,
const char *arg)
{
+ if (ma_server_rec !=NULL && ma_server_rec != cmd->server)
+ return "All Advertise directives must be in the same VirtualHost";
+ if (ma_server_rec == NULL)
+ ma_server_rec = cmd->server;
+
if (ma_advertise_skey != NULL)
return "Duplicate AdvertiseSecurityKey directives are not allowed";
ma_advertise_skey = apr_pstrdup(cmd->pool, arg);
@@ -232,6 +252,11 @@
static const char *cmd_advertise_h(cmd_parms *cmd, void *dummy,
const char *arg)
{
+ if (ma_server_rec !=NULL && ma_server_rec != cmd->server)
+ return "All Advertise directives must be in the same VirtualHost";
+ if (ma_server_rec == NULL)
+ ma_server_rec = cmd->server;
+
if (ma_advertise_srvh != NULL)
return "Duplicate AdvertiseManagerUrl directives are not allowed";
ma_advertise_srvh = apr_pstrdup(cmd->pool, arg);
Show replies by date