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/08/19 19:19:58 UTC

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

Author: mturk
Date: Fri Aug 19 10:19:54 2005
New Revision: 233514

URL: http://svn.apache.org/viewcvs?rev=233514&view=rev
Log:
Revert the hack for setting the lbmethod.
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.

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?rev=233514&r1=233513&r2=233514&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_balancer.c Fri Aug 19 10:19:54 2005
@@ -359,6 +359,11 @@
     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 @@
     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 @@
         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;