]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Implement reset() funcs for the LBmethods...
authorJim Jagielski <jim@apache.org>
Thu, 31 Mar 2011 18:41:23 +0000 (18:41 +0000)
committerJim Jagielski <jim@apache.org>
Thu, 31 Mar 2011 18:41:23 +0000 (18:41 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1087407 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/balancers/mod_lbmethod_bybusyness.c
modules/proxy/balancers/mod_lbmethod_byrequests.c
modules/proxy/balancers/mod_lbmethod_bytraffic.c

index d27aa395bdf969931a2c0f6205a3499d14e6c868..18dc2bdb8838fce03d473452d528f63fb6765974 100644 (file)
@@ -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) {
index 9b453ceaf3656da7678a6cd2360088de5d782e6c..4a9885d517e24a26e6e1b62f6e12e450cbabd5d0 100644 (file)
@@ -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) {
index d0aea4bf1f3c5fbcca51b90dbd438f6f74ded0cc..fc058a6ce65dc8431ee8f4588f7dd03682ea4f33 100644 (file)
@@ -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) {