From 83a044b23a12b61bb13ff9e157cb47448a9d64b4 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Fri, 8 Dec 2006 21:13:01 +0000 Subject: [PATCH] No need for each ind lb method to increment the elected element. Do so from the main calling func. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@484783 13f79535-47bb-0310-9956-ffa450edef68 --- modules/proxy/mod_proxy_balancer.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/modules/proxy/mod_proxy_balancer.c b/modules/proxy/mod_proxy_balancer.c index 4204d71206..64f79ba547 100644 --- a/modules/proxy/mod_proxy_balancer.c +++ b/modules/proxy/mod_proxy_balancer.c @@ -293,6 +293,9 @@ static proxy_worker *find_best_worker(proxy_balancer *balancer, candidate = (*balancer->lbmethod->finder)(balancer, r); + if (candidate) + candidate->s->elected++; + /* PROXY_THREAD_UNLOCK(balancer); return NULL; @@ -976,7 +979,6 @@ static proxy_worker *find_best_byrequests(proxy_balancer *balancer, if (mycandidate) { mycandidate->s->lbstatus -= total_factor; - mycandidate->s->elected++; } return mycandidate; @@ -1055,10 +1057,6 @@ static proxy_worker *find_best_bytraffic(proxy_balancer *balancer, cur_lbset++; } while (cur_lbset <= max_lbset && !mycandidate); - if (mycandidate) { - mycandidate->s->elected++; - } - return mycandidate; }