Author: jfrederic.clere(a)jboss.com
Date: 2009-03-06 06:08:46 -0500 (Fri, 06 Mar 2009)
New Revision: 2339
Modified:
trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
Log:
more optimisations :-(
Modified: trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
===================================================================
--- trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2009-03-06 10:49:56 UTC
(rev 2338)
+++ trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2009-03-06 11:08:46 UTC
(rev 2339)
@@ -884,7 +884,7 @@
* stopped in one node but not in others.
* We also try the domain.
*/
-static proxy_worker *internal_find_best_byrequests(proxy_balancer *balancer,
+static proxy_worker *internal_find_best_byrequests(proxy_balancer *balancer,
proxy_server_conf *conf,
request_rec *r, const char *domain, int
failoverdomain)
{
int i;
@@ -893,9 +893,6 @@
int checking_standby = 0;
int checked_standby = 0;
int checked_domain = 1;
- void *sconf = r->server->module_config;
- proxy_server_conf *conf = (proxy_server_conf *)
- ap_get_module_config(sconf, &proxy_module);
ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
"proxy: Entering byrequests for CLUSTER (%s)",
@@ -986,17 +983,6 @@
}
return mycandidate;
}
-static proxy_worker *find_best_byrequests(proxy_balancer *balancer,
- request_rec *r)
-{
- return (internal_find_best_byrequests(balancer, r, NULL, 0));
-}
-static const proxy_balancer_method byrequests =
-{
- "byrequests",
- &find_best_byrequests,
- NULL
-};
/*
* Do a ping/pong to the node
@@ -1556,7 +1542,7 @@
return worker;
}
-static proxy_worker *find_best_worker(proxy_balancer *balancer,
+static proxy_worker *find_best_worker(proxy_balancer *balancer, proxy_server_conf *conf,
request_rec *r, const char *domain, int
failoverdomain)
{
proxy_worker *candidate = NULL;
@@ -1569,7 +1555,7 @@
}
/* XXX: candidate = (*balancer->lbmethod->finder)(balancer, r); */
- candidate = internal_find_best_byrequests(balancer, r, domain, failoverdomain);
+ candidate = internal_find_best_byrequests(balancer, conf, r, domain,
failoverdomain);
if (candidate) {
proxy_cluster_helper *helper;
@@ -1607,7 +1593,7 @@
while (tval < timeout) {
apr_sleep(step);
/* Try again */
- if ((candidate = find_best_worker(balancer, r, domain, failoverdomain)))
+ if ((candidate = find_best_worker(balancer, conf, r, domain,
failoverdomain)))
break;
tval += step;
}
@@ -1818,7 +1804,7 @@
/*
* We have to failover (in domain only may be) or we don't use sticky
sessions
*/
- runtime = find_best_worker(*balancer, r, domain, failoverdomain);
+ runtime = find_best_worker(*balancer, conf, r, domain, failoverdomain);
if (!runtime) {
ap_log_error(APLOG_MARK, APLOG_ERR, 0, r->server,
"proxy: CLUSTER: (%s). All workers are in error
state",
@@ -1957,9 +1943,6 @@
ap_hook_post_config(proxy_cluster_post_config, NULL, NULL, APR_HOOK_MIDDLE);
- /* create the provider for the proxy logic */
- ap_register_provider(p, PROXY_LBMETHOD, "cluster_byrequests",
"0", &byrequests);
-
/* create the "maintenance" thread */
ap_hook_child_init(proxy_cluster_child_init, NULL, NULL, APR_HOOK_MIDDLE);