httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j..@apache.org
Subject svn commit: r594931 - /httpd/httpd/trunk/modules/proxy/mod_lbmethod_rr.c
Date Wed, 14 Nov 2007 16:25:01 GMT
Author: jim
Date: Wed Nov 14 08:25:00 2007
New Revision: 594931

URL: http://svn.apache.org/viewvc?rev=594931&view=rev
Log:
Some fixes before we move this to an example's dir, but
remove the unneeded CORE_PRIVATE and bypass inf loop,
but *still* this is not intended to be a module to
*use* but rather as an example that yes, you can add
lbmethods via sub-module prvider.

Modified:
    httpd/httpd/trunk/modules/proxy/mod_lbmethod_rr.c

Modified: httpd/httpd/trunk/modules/proxy/mod_lbmethod_rr.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_lbmethod_rr.c?rev=594931&r1=594930&r2=594931&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_lbmethod_rr.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_lbmethod_rr.c Wed Nov 14 08:25:00 2007
@@ -14,15 +14,13 @@
  * limitations under the License.
  */
 
-/* Round Robin lbmethod module for Apache proxy */
+/* Round Robin lbmethod EXAMPLE module for Apache proxy */
 
 /* NOTE: This is designed simply to provide some info on how to create
          extra lbmethods via sub-modules... This code is ugly
          and needs work to actually do round-robin "right"
          but that is left as an exercise for the reader */
 
-#define CORE_PRIVATE
-
 #include "mod_proxy.h"
 #include "scoreboard.h"
 #include "ap_mpm.h"
@@ -70,26 +68,25 @@
                  "proxy: roundrobin index: %d (%d)",
                  ctx->index, (int)getpid());
 
-    do {
-        checking_standby = checked_standby = 0;
-        while (!mycandidate && !checked_standby) {
-            worker = (proxy_worker *)balancer->workers->elts;
-
-            for (i = 0; i < balancer->workers->nelts; i++, worker++) {
-                if (i < ctx->index)
-                    continue;
-                if ( (checking_standby ? !PROXY_WORKER_IS_STANDBY(worker) : PROXY_WORKER_IS_STANDBY(worker))
)
-                    continue;
-                if (!PROXY_WORKER_IS_USABLE(worker))
-                    ap_proxy_retry_worker("BALANCER", worker, r->server);
-                if (PROXY_WORKER_IS_USABLE(worker)) {
-                    mycandidate = worker;
-                    break;
-                }
+    checking_standby = checked_standby = 0;
+    while (!mycandidate && !checked_standby) {
+        worker = (proxy_worker *)balancer->workers->elts;
+
+        for (i = 0; i < balancer->workers->nelts; i++, worker++) {
+            if (i < ctx->index)
+                continue;
+            if ( (checking_standby ? !PROXY_WORKER_IS_STANDBY(worker) : PROXY_WORKER_IS_STANDBY(worker))
)
+                continue;
+            if (!PROXY_WORKER_IS_USABLE(worker))
+                ap_proxy_retry_worker("BALANCER", worker, r->server);
+            if (PROXY_WORKER_IS_USABLE(worker)) {
+                mycandidate = worker;
+                break;
             }
-            checked_standby = checking_standby++;
         }
-    } while (!mycandidate);
+        checked_standby = checking_standby++;
+    }
+
 
     ctx->index += 1;
     if (ctx->index >= balancer->workers->nelts) {



Mime
View raw message