]> granicus.if.org Git - apache/commitdiff
Revert the hack for setting the lbmethod.
authorMladen Turk <mturk@apache.org>
Fri, 19 Aug 2005 17:19:54 +0000 (17:19 +0000)
committerMladen Turk <mturk@apache.org>
Fri, 19 Aug 2005 17:19:54 +0000 (17:19 +0000)
The problem is deeper inside caused by the
new hook to the balancer module that is never
called on WIN32.
Although the hack fixed core dump, the proxy is
still unusable because the configuration is failing
due to the empty lbmethod names array.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@233514 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/mod_proxy_balancer.c

index cebfd5919936a6e875a5a59397ce73a8aa62b03d..a0711350ad31e7f98230347c13730eae240e7fb5 100644 (file)
@@ -359,6 +359,11 @@ static proxy_worker *find_best_bytraffic(proxy_balancer *balancer,
     return mycandidate;
 }
 
+static proxy_balancer_method _default_lbmethod = {
+      "byrequests",
+      find_best_byrequests
+};
+    
 static proxy_worker *find_best_worker(proxy_balancer *balancer,
                                       request_rec *r)
 {
@@ -367,13 +372,6 @@ static proxy_worker *find_best_worker(proxy_balancer *balancer,
     if (PROXY_THREAD_LOCK(balancer) != APR_SUCCESS)
         return NULL;    
 
-    if (!(*balancer->lbmethod->finder)) {
-        /* XXX: UGLY HACK!!!
-         * Where is the finder function setup? 
-         */
-        balancer->lbmethod->finder = find_best_byrequests;
-    }
-
     candidate = (*balancer->lbmethod->finder)(balancer, r);
 
 /*    
@@ -879,6 +877,9 @@ static void child_init(apr_pool_t *p, server_rec *s)
         balancer = (proxy_balancer *)conf->balancers->elts;
         for (i = 0; i < conf->balancers->nelts; i++) {
             init_balancer_members(conf, s, balancer);
+            if (!balancer->lbmethod->finder) {
+                balancer->lbmethod->finder = _default_lbmethod;
+            }
             balancer++;
         }
         s = s->next;