mturk 2004/08/10 06:52:51 Modified: ajp/proxy proxy_balancer.c Log: 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. Revision Changes Path 1.5 +9 -8 jakarta-tomcat-connectors/ajp/proxy/proxy_balancer.c Index: proxy_balancer.c =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/ajp/proxy/proxy_balancer.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- proxy_balancer.c 9 Aug 2004 15:08:28 -0000 1.4 +++ proxy_balancer.c 10 Aug 2004 13:52:51 -0000 1.5 @@ -31,6 +31,7 @@ #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 @@ * 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 @@ * 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 @@ /* 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 @@ 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++; } }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]