Author: jfrederic.clere(a)jboss.com
Date: 2009-01-29 08:45:37 -0500 (Thu, 29 Jan 2009)
New Revision: 2243
Modified:
trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
Log:
Update the table before looking for a balancer.
Modified: trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c
===================================================================
--- trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2009-01-29 13:43:23 UTC
(rev 2242)
+++ trunk/mod_cluster/native/mod_proxy_cluster/mod_proxy_cluster.c 2009-01-29 13:45:37 UTC
(rev 2243)
@@ -1489,14 +1489,24 @@
*/
static int proxy_cluster_trans(request_rec *r)
{
- const char *balancer = get_route_balancer(r);
- if (!balancer)
- balancer = get_context_host_balancer(r);
+ const char *balancer;
ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_DEBUG, 0, r->server,
"proxy_cluster_trans for %d %s %s uri: %s",
r->proxyreq, r->filename, r->handler, r->uri);
+ balancer = get_route_balancer(r);
+ if (!balancer) {
+ void *sconf = r->server->module_config;
+ proxy_server_conf *conf = (proxy_server_conf *)
+ ap_get_module_config(sconf, &proxy_module);
+ /* May be the balancer has not been created (XXX: use shared memory to find the
balancer ...) */
+ update_workers_node(conf, r->pool, r->server);
+ balancer = get_route_balancer(r);
+ }
+ if (!balancer)
+ balancer = get_context_host_balancer(r);
+
if (balancer) {
r->filename = apr_pstrcat(r->pool, "proxy:cluster://", balancer,
r->uri, NULL);
r->handler = "proxy-server";
Show replies by date