Author: jfrederic.clere(a)jboss.com
Date: 2009-05-26 03:25:30 -0400 (Tue, 26 May 2009)
New Revision: 2450
Modified:
trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
Log:
Arrange add_balancers_workers() and clean stuff.
Modified: trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
===================================================================
--- trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2009-05-25 16:40:25 UTC
(rev 2449)
+++ trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2009-05-26 07:25:30 UTC
(rev 2450)
@@ -79,7 +79,7 @@
#define CREAT_ALL 0 /* create balancers/workers in all VirtualHost */
#define CREAT_NONE 1 /* don't create balancers (but add workers) */
#define CREAT_ROOT 2 /* Only create balancers/workers in the main server */
-static int creat_bal = 2;
+static int creat_bal = CREAT_ROOT;
#define WAITFORREMOVE 10 /* seconds */
@@ -442,9 +442,8 @@
}
/*
* Adds the balancers and the workers to the VirtualHosts
- * Note server is only here for logging purposes.
*/
-static void add_balancers_workers(nodeinfo_t *node, apr_pool_t *pool, server_rec
*server)
+static void add_balancers_workers(nodeinfo_t *node, apr_pool_t *pool)
{
server_rec *s = main_server;
char *name = apr_pstrcat(pool, "balancer://", node->mess.balancer,
NULL);
@@ -458,7 +457,7 @@
s = s->next;
continue;
}
- add_workers_node(node, conf, balancer, name, pool, server);
+ add_workers_node(node, conf, balancer, name, pool, s);
if (creat_bal == CREAT_ROOT)
break;
s = s->next;
@@ -1228,7 +1227,7 @@
return 500;
/* create the balancers and workers (that could be the first time) */
- add_balancers_workers(node, r->pool, r->server);
+ add_balancers_workers(node, r->pool);
/* search for the worker in the VirtualHosts */
while (s) {
@@ -2004,7 +2003,7 @@
#if HAVE_CLUSTER_EX_DEBUG
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
- "proxy: CLUSTER (%s) worker (%s) rewritten to %s",
+ "proxy_cluster_pre_request: balancer (%s) worker (%s) rewritten to
%s",
(*balancer)->name, (*worker)->name, *url);
#endif