httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jfcl...@apache.org
Subject svn commit: r773929 - in /httpd/httpd/trunk/modules/proxy: ./ balancers/ examples/
Date Tue, 12 May 2009 15:10:57 GMT
Author: jfclere
Date: Tue May 12 15:10:56 2009
New Revision: 773929

URL: http://svn.apache.org/viewvc?rev=773929&view=rev
Log:
Arrange the proxy_balancer_method:
- Put context back after the finder().
- Use  server_rec as second parameter for reset() and age().
- Add the call for reset().

Modified:
    httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_bybusyness.c
    httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_byrequests.c
    httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_bytraffic.c
    httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_heartbeat.c
    httpd/httpd/trunk/modules/proxy/examples/mod_lbmethod_rr.c
    httpd/httpd/trunk/modules/proxy/mod_proxy.h
    httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c

Modified: httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_bybusyness.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_bybusyness.c?rev=773929&r1=773928&r2=773929&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_bybusyness.c (original)
+++ httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_bybusyness.c Tue May 12 15:10:56
2009
@@ -105,11 +105,11 @@
 
 }
 
-static apr_status_t reset(proxy_balancer *balancer, request_rec *r) {
+static apr_status_t reset(proxy_balancer *balancer, server_rec *r) {
         return APR_SUCCESS;
 }
 
-static apr_status_t age(proxy_balancer *balancer, request_rec *r) {
+static apr_status_t age(proxy_balancer *balancer, server_rec *r) {
         return APR_SUCCESS;
 }
 
@@ -117,9 +117,9 @@
 {
     "bybusyness",
     &find_best_bybusyness,
+    NULL,
     &reset,
-    &age,
-    NULL
+    &age
 };
 
 

Modified: httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_byrequests.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_byrequests.c?rev=773929&r1=773928&r2=773929&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_byrequests.c (original)
+++ httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_byrequests.c Tue May 12 15:10:56
2009
@@ -132,11 +132,11 @@
     return mycandidate;
 }
 
-static apr_status_t reset(proxy_balancer *balancer, request_rec *r) {
+static apr_status_t reset(proxy_balancer *balancer, server_rec *r) {
         return APR_SUCCESS;
 }
 
-static apr_status_t age(proxy_balancer *balancer, request_rec *r) {
+static apr_status_t age(proxy_balancer *balancer, server_rec *r) {
         return APR_SUCCESS;
 }
 
@@ -150,9 +150,9 @@
 {
     "byrequests",
     &find_best_byrequests,
+    NULL,
     &reset,
-    &age,
-    NULL
+    &age
 };
 
 static void register_hook(apr_pool_t *p)

Modified: httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_bytraffic.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_bytraffic.c?rev=773929&r1=773928&r2=773929&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_bytraffic.c (original)
+++ httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_bytraffic.c Tue May 12 15:10:56
2009
@@ -105,11 +105,11 @@
     return mycandidate;
 }
 
-static apr_status_t reset(proxy_balancer *balancer, request_rec *r) {
+static apr_status_t reset(proxy_balancer *balancer, server_rec *r) {
         return APR_SUCCESS;
 }
 
-static apr_status_t age(proxy_balancer *balancer, request_rec *r) {
+static apr_status_t age(proxy_balancer *balancer, server_rec *r) {
         return APR_SUCCESS;
 }
 
@@ -117,9 +117,9 @@
 {
     "bytraffic",
     &find_best_bytraffic,
+    NULL,
     &reset,
-    &age,
-    NULL
+    &age
 };
 
 static void register_hook(apr_pool_t *p)

Modified: httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_heartbeat.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_heartbeat.c?rev=773929&r1=773928&r2=773929&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_heartbeat.c (original)
+++ httpd/httpd/trunk/modules/proxy/balancers/mod_lbmethod_heartbeat.c Tue May 12 15:10:56
2009
@@ -299,11 +299,11 @@
     return mycandidate;
 }
 
-static apr_status_t reset(proxy_balancer *balancer, request_rec *r) {
+static apr_status_t reset(proxy_balancer *balancer, server_rec *r) {
         return APR_SUCCESS;
 }
 
-static apr_status_t age(proxy_balancer *balancer, request_rec *r) {
+static apr_status_t age(proxy_balancer *balancer, server_rec *r) {
         return APR_SUCCESS;
 }
 
@@ -311,9 +311,9 @@
 {
     "heartbeat",
     &find_best_hb,
+    NULL,
     &reset,
-    &age,
-    NULL
+    &age
 };
 
 static void register_hooks(apr_pool_t *p)

Modified: httpd/httpd/trunk/modules/proxy/examples/mod_lbmethod_rr.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/examples/mod_lbmethod_rr.c?rev=773929&r1=773928&r2=773929&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/examples/mod_lbmethod_rr.c (original)
+++ httpd/httpd/trunk/modules/proxy/examples/mod_lbmethod_rr.c Tue May 12 15:10:56 2009
@@ -95,11 +95,21 @@
     return mycandidate;
 }
 
+static apr_status_t reset(proxy_balancer *balancer, server_rec *r) {
+        return APR_SUCCESS;
+}
+
+static apr_status_t age(proxy_balancer *balancer, server_rec *r) {
+        return APR_SUCCESS;
+}
+
 static const proxy_balancer_method roundrobin =
 {
     "roundrobin",
     &find_best_roundrobin,
-    NULL
+    NULL,
+    &reset,
+    &age
 };
 
 

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy.h?rev=773929&r1=773928&r2=773929&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy.h (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy.h Tue May 12 15:10:56 2009
@@ -390,9 +390,9 @@
     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 */
+    apr_status_t (*reset)(proxy_balancer *balancer, server_rec *r);
+    apr_status_t (*age)(proxy_balancer *balancer, server_rec *r);
 };
 
 #if APR_HAS_THREADS

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c?rev=773929&r1=773928&r2=773929&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c Tue May 12 15:10:56 2009
@@ -941,6 +941,9 @@
         /* Initialize shared scoreboard data */
         balancer = (proxy_balancer *)conf->balancers->elts;
         for (i = 0; i < conf->balancers->nelts; i++) {
+            proxy_balancer_method *lbmethod = balancer->lbmethod;
+            if (balancer->lbmethod!=NULL && balancer->lbmethod->reset !=
NULL)
+               balancer->lbmethod->reset(balancer, s);
             init_balancer_members(conf, s, balancer);
             balancer++;
         }



Mime
View raw message