]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Fold in initial template for methods to be able to
authorJim Jagielski <jim@apache.org>
Mon, 27 Apr 2009 15:02:40 +0000 (15:02 +0000)
committerJim Jagielski <jim@apache.org>
Mon, 27 Apr 2009 15:02:40 +0000 (15:02 +0000)
reset (initialize) and "age" their data, useful when
adding new workers, or when workers come back into
the fold....

Logic and code to come in a bit :)

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@769020 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
modules/proxy/balancers/mod_lbmethod_heartbeat.c
modules/proxy/mod_proxy.h
modules/proxy/proxy_util.c

index 5bdeef7e7d4141f3619b2a2256620490124721b7..0e5ebc87a144efd5fc46f305604a2d4eab9cf367 100644 (file)
@@ -105,10 +105,20 @@ static proxy_worker *find_best_bybusyness(proxy_balancer *balancer,
 
 }
 
+static apr_status_t reset(proxy_balancer *balancer, request_rec *r) {
+        return APR_SUCCESS;
+}
+
+static apr_status_t age(proxy_balancer *balancer, request_rec *r) {
+        return APR_SUCCESS;
+}
+
 static const proxy_balancer_method bybusyness =
 {
     "bybusyness",
     &find_best_bybusyness,
+    &reset,
+    &age,
     NULL
 };
 
index f5ff91d0149bf147d6654e3792628a4bfa0f66ad..fc15db6c089f5a919e3b467c40da82524048cba6 100644 (file)
@@ -132,6 +132,14 @@ static proxy_worker *find_best_byrequests(proxy_balancer *balancer,
     return mycandidate;
 }
 
+static apr_status_t reset(proxy_balancer *balancer, request_rec *r) {
+        return APR_SUCCESS;
+}
+
+static apr_status_t age(proxy_balancer *balancer, request_rec *r) {
+        return APR_SUCCESS;
+}
+
 /*
  * How to add additional lbmethods:
  *   1. Create func which determines "best" candidate worker
@@ -142,6 +150,8 @@ static const proxy_balancer_method byrequests =
 {
     "byrequests",
     &find_best_byrequests,
+    &reset,
+    &age,
     NULL
 };
 
index d1d882bd15dcce0a8995cef6b39e737796cb9ec4..e2b339a8e89c24641fc28f4ef00e3f3df974b77a 100644 (file)
@@ -105,10 +105,20 @@ static proxy_worker *find_best_bytraffic(proxy_balancer *balancer,
     return mycandidate;
 }
 
+static apr_status_t reset(proxy_balancer *balancer, request_rec *r) {
+        return APR_SUCCESS;
+}
+
+static apr_status_t age(proxy_balancer *balancer, request_rec *r) {
+        return APR_SUCCESS;
+}
+
 static const proxy_balancer_method bytraffic =
 {
     "bytraffic",
     &find_best_bytraffic,
+    &reset,
+    &age,
     NULL
 };
 
index 571c0e70b49cd2a72ed06d7c284225cbd019f2c8..094e7e53d97f22f91828a59a49e228624da90505 100644 (file)
@@ -299,10 +299,20 @@ static proxy_worker *find_best_hb(proxy_balancer *balancer,
     return mycandidate;
 }
 
+static apr_status_t reset(proxy_balancer *balancer, request_rec *r) {
+        return APR_SUCCESS;
+}
+
+static apr_status_t age(proxy_balancer *balancer, request_rec *r) {
+        return APR_SUCCESS;
+}
+
 static const proxy_balancer_method heartbeat =
 {
     "heartbeat",
     &find_best_hb,
+    &reset,
+    &age,
     NULL
 };
 
index 70996983d22d7d0278918607a3dc5ddcccf633e4..9963594178ed9dc82927cd036b176ccc553e294a 100644 (file)
@@ -390,6 +390,8 @@ struct proxy_balancer_method {
     const char *name;            /* name of the load balancer method*/
     proxy_worker *(*finder)(proxy_balancer *balancer,
                             request_rec *r);
+    apr_status_t (*reset)(proxy_balancer *balancer, request_rec *r);
+    apr_status_t (*age)(proxy_balancer *balancer, request_rec *r);
     void            *context;   /* general purpose storage */
 };
 
index 22deafea77aaaa211a6f03c1108a883b3b39729a..fd29389cf3bb75f23d07505583c5ff26dcaa8859 100644 (file)
@@ -2346,6 +2346,8 @@ PROXY_DECLARE(int) ap_proxy_connect_backend(const char *proxy_function,
             worker->hostname);
     }
     else {
+        if (worker->s->retries) {
+        }
         worker->s->error_time = 0;
         worker->s->retries = 0;
     }