summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Jagielski <jim@apache.org>2011-03-31 20:41:23 +0200
committerJim Jagielski <jim@apache.org>2011-03-31 20:41:23 +0200
commitb405eca0381663613269b6d87ca68e39c28b81fd (patch)
treebd5be9860eddc1b754a92affd1aea7387b8cda88
parentIf we change the LB method, or we take add in a new (diff)
downloadapache2-b405eca0381663613269b6d87ca68e39c28b81fd.tar.xz
apache2-b405eca0381663613269b6d87ca68e39c28b81fd.zip
Implement reset() funcs for the LBmethods...
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1087407 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--modules/proxy/balancers/mod_lbmethod_bybusyness.c10
-rw-r--r--modules/proxy/balancers/mod_lbmethod_byrequests.c9
-rw-r--r--modules/proxy/balancers/mod_lbmethod_bytraffic.c12
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) {