diff options
-rw-r--r-- | modules/proxy/balancers/mod_lbmethod_bybusyness.c | 10 | ||||
-rw-r--r-- | modules/proxy/balancers/mod_lbmethod_byrequests.c | 9 | ||||
-rw-r--r-- | modules/proxy/balancers/mod_lbmethod_bytraffic.c | 12 |
3 files changed, 28 insertions, 3 deletions
diff --git a/modules/proxy/balancers/mod_lbmethod_bybusyness.c b/modules/proxy/balancers/mod_lbmethod_bybusyness.c index d27aa395bd..18dc2bdb88 100644 --- a/modules/proxy/balancers/mod_lbmethod_bybusyness.c +++ b/modules/proxy/balancers/mod_lbmethod_bybusyness.c @@ -105,8 +105,16 @@ static proxy_worker *find_best_bybusyness(proxy_balancer *balancer, } +/* assumed to be mutex protected by caller */ static apr_status_t reset(proxy_balancer *balancer, server_rec *s) { - return APR_SUCCESS; + int i; + proxy_worker **worker; + worker = (proxy_worker **)balancer->workers->elts; + for (i = 0; i < balancer->workers->nelts; i++, worker++) { + (*worker)->s->lbstatus = 0; + (*worker)->s->busy = 0; + } + return APR_SUCCESS; } static apr_status_t age(proxy_balancer *balancer, server_rec *s) { diff --git a/modules/proxy/balancers/mod_lbmethod_byrequests.c b/modules/proxy/balancers/mod_lbmethod_byrequests.c index 9b453ceaf3..4a9885d517 100644 --- a/modules/proxy/balancers/mod_lbmethod_byrequests.c +++ b/modules/proxy/balancers/mod_lbmethod_byrequests.c @@ -132,8 +132,15 @@ static proxy_worker *find_best_byrequests(proxy_balancer *balancer, return mycandidate; } +/* assumed to be mutex protected by caller */ static apr_status_t reset(proxy_balancer *balancer, server_rec *s) { - return APR_SUCCESS; + int i; + proxy_worker **worker; + worker = (proxy_worker **)balancer->workers->elts; + for (i = 0; i < balancer->workers->nelts; i++, worker++) { + (*worker)->s->lbstatus = 0; + } + return APR_SUCCESS; } static apr_status_t age(proxy_balancer *balancer, server_rec *s) { diff --git a/modules/proxy/balancers/mod_lbmethod_bytraffic.c b/modules/proxy/balancers/mod_lbmethod_bytraffic.c index d0aea4bf1f..fc058a6ce6 100644 --- a/modules/proxy/balancers/mod_lbmethod_bytraffic.c +++ b/modules/proxy/balancers/mod_lbmethod_bytraffic.c @@ -105,8 +105,18 @@ static proxy_worker *find_best_bytraffic(proxy_balancer *balancer, return mycandidate; } +/* assumed to be mutex protected by caller */ static apr_status_t reset(proxy_balancer *balancer, server_rec *s) { - return APR_SUCCESS; + int i; + proxy_worker **worker; + worker = (proxy_worker **)balancer->workers->elts; + for (i = 0; i < balancer->workers->nelts; i++, worker++) { + (*worker)->s->lbstatus = 0; + (*worker)->s->busy = 0; + (*worker)->s->transferred = 0; + (*worker)->s->read = 0; + } + return APR_SUCCESS; } static apr_status_t age(proxy_balancer *balancer, server_rec *s) { |