From ec90a6826c861f932079c3c8654f24d73753dce3 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 11 Aug 2004 23:03:43 +0000 Subject: [PATCH] Use the proxy_runtime_stat that either comes from scoreboard or directly allocating memory if there is no scoreboard support or it is not neaded, due to the fact that we have single child process. Submitted by: mturk git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104618 13f79535-47bb-0310-9956-ffa450edef68 --- modules/proxy/proxy_balancer.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/modules/proxy/proxy_balancer.c b/modules/proxy/proxy_balancer.c index 9bce6acf59..ab832399d1 100644 --- a/modules/proxy/proxy_balancer.c +++ b/modules/proxy/proxy_balancer.c @@ -31,6 +31,7 @@ module AP_MODULE_DECLARE_DATA proxy_balancer_module; #define PROXY_BALANCER_UNLOCK(b) APR_SUCCESS #endif + /* Retrieve the parameter with the given name */ static char *get_path_param(apr_pool_t *pool, char *url, const char *name) @@ -162,7 +163,7 @@ static proxy_runtime_worker *find_best_worker(proxy_balancer *balancer, * This is for cases when worker is in error state. * It will force the even request distribution */ - total_factor += worker->lbfactor; + total_factor += worker->s->lbfactor; } worker++; } @@ -207,7 +208,7 @@ static proxy_runtime_worker *find_best_worker(proxy_balancer *balancer, * Lbstatus is of higher importance then * the number of empty slots. */ - if (worker->lbstatus > candidate->lbstatus) { + if (worker->s->lbstatus > candidate->s->lbstatus) { candidate = worker; } } @@ -221,9 +222,9 @@ static proxy_runtime_worker *find_best_worker(proxy_balancer *balancer, /* XXX: The lbfactor can be update using bytes transfered * Right now, use the round-robin scheme */ - worker->lbstatus += worker->lbfactor; - if (worker->lbstatus >= total_factor) - worker->lbstatus = worker->lbfactor; + worker->s->lbstatus += worker->s->lbfactor; + if (worker->s->lbstatus >= total_factor) + worker->s->lbstatus = worker->s->lbfactor; } worker++; } @@ -289,9 +290,9 @@ static int proxy_balancer_pre_request(proxy_worker **worker, workers = (proxy_runtime_worker *)(*balancer)->workers->elts; for (i = 0; i < (*balancer)->workers->nelts; i++) { /* For now assume that all workers are OK */ - workers->lbstatus += workers->lbfactor; - if (workers->lbstatus >= 100.0) - workers->lbstatus = workers->lbfactor; + workers->s->lbstatus += workers->s->lbfactor; + if (workers->s->lbstatus >= 100.0) + workers->s->lbstatus = workers->s->lbfactor; workers++; } } -- 2.40.0