Commit 045415a8 authored by Jim Jagielski's avatar Jim Jagielski
Browse files

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
parent 1525ad20
Loading
Loading
Loading
Loading
+3 −5
Changes for modules/proxy/mod_proxy_balancer.c: 3 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -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;
}