You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by mt...@apache.org on 2005/04/11 10:42:35 UTC

svn commit: r160847 - httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c

Author: mturk
Date: Mon Apr 11 01:42:33 2005
New Revision: 160847

URL: http://svn.apache.org/viewcvs?view=rev&rev=160847
Log:
Set default number of maxattempts to the number of
balancer members.

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

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c?view=diff&r1=160846&r2=160847
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c Mon Apr 11 01:42:33 2005
@@ -93,6 +93,13 @@
         workers[i].s->lbstatus = workers[i].s->lbfactor =
           (workers[i].lbfactor ? workers[i].lbfactor : 1);
     }
+    /* Set default number of attempts to the number of
+     * workers.
+     */
+    if (!balancer->max_attempts_set && balancer->workers->nelts > 1) {
+        balancer->max_attempts = balancer->workers->nelts - 1;
+        balancer->max_attempts_set = 1;
+    }
     return 0;
 }
 
@@ -440,8 +447,11 @@
     *worker = NULL;
     /* Step 1: check if the url is for us 
      * The url we can handle starts with 'balancer://'
+     * If balancer is already provided skip the search
+     * for balancer, because this is failover attempt.
      */
-    if (!(*balancer = ap_proxy_get_balancer(r->pool, conf, *url)))
+    if (!*balancer &&
+        !(*balancer = ap_proxy_get_balancer(r->pool, conf, *url)))
         return DECLINED;
     
     /* Step 2: find the session route */