1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-07 04:02:58 +03:00

Logic which makes the balancer "active" or not... so we can turn them

off and on as needed.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1207926 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jim Jagielski
2011-11-29 15:36:11 +00:00
parent a46b040440
commit d2e320f509
4 changed files with 18 additions and 11 deletions

View File

@@ -1091,7 +1091,7 @@ PROXY_DECLARE(const char *) ap_proxy_location_reverse_map(request_rec *r,
* to find which member actually handled this request.
*/
if (ap_proxy_valid_balancer_name((char *)real, 0) &&
(balancer = ap_proxy_get_balancer(r->pool, sconf, real))) {
(balancer = ap_proxy_get_balancer(r->pool, sconf, real, 1))) {
int n, l3 = 0;
proxy_worker **worker = (proxy_worker **)balancer->workers->elts;
const char *urlpart = ap_strchr_c(real, '/');
@@ -1292,7 +1292,8 @@ PROXY_DECLARE(int) ap_proxy_valid_balancer_name(char *name, int i)
PROXY_DECLARE(proxy_balancer *) ap_proxy_get_balancer(apr_pool_t *p,
proxy_server_conf *conf,
const char *url)
const char *url,
int care)
{
proxy_balancer *balancer;
char *c, *uri = apr_pstrdup(p, url);
@@ -1309,7 +1310,9 @@ PROXY_DECLARE(proxy_balancer *) ap_proxy_get_balancer(apr_pool_t *p,
balancer = (proxy_balancer *)conf->balancers->elts;
for (i = 0; i < conf->balancers->nelts; i++) {
if (strcasecmp(balancer->s->name, uri) == 0) {
return balancer;
if (!care || !balancer->s->inactive) {
return balancer;
}
}
balancer++;
}