You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ji...@apache.org on 2019/04/02 15:00:44 UTC

svn commit: r1856829 - /httpd/httpd/trunk/modules/proxy/proxy_util.c

Author: jim
Date: Tue Apr  2 15:00:43 2019
New Revision: 1856829

URL: http://svn.apache.org/viewvc?rev=1856829&view=rev
Log:
Fix for: [Bug 62372] Load balancer byrequests required when bytraffic chosen


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

Modified: httpd/httpd/trunk/modules/proxy/proxy_util.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/proxy_util.c?rev=1856829&r1=1856828&r2=1856829&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/proxy_util.c (original)
+++ httpd/httpd/trunk/modules/proxy/proxy_util.c Tue Apr  2 15:00:43 2019
@@ -1165,13 +1165,13 @@ PROXY_DECLARE(char *) ap_proxy_define_ba
      * exist, that's OK at this time. We check when we share and sync
      */
     lbmethod = ap_lookup_provider(PROXY_LBMETHOD, "byrequests", "0");
-
+    (*balancer)->lbmethod = lbmethod;
+    
     (*balancer)->workers = apr_array_make(p, 5, sizeof(proxy_worker *));
 #if APR_HAS_THREADS
     (*balancer)->gmutex = NULL;
     (*balancer)->tmutex = NULL;
 #endif
-    (*balancer)->lbmethod = lbmethod;
 
     if (do_malloc)
         bshared = ap_malloc(sizeof(proxy_balancer_shared));
@@ -1185,6 +1185,8 @@ PROXY_DECLARE(char *) ap_proxy_define_ba
     if (PROXY_STRNCPY(bshared->name, uri) != APR_SUCCESS) {
         return apr_psprintf(p, "balancer name (%s) too long", uri);
     }
+    (*balancer)->lbmethod_set = 1;
+
     /*
      * We do the below for verification. The real sname will be
      * done post_config
@@ -1239,6 +1241,7 @@ PROXY_DECLARE(apr_status_t) ap_proxy_sha
     lbmethod = ap_lookup_provider(PROXY_LBMETHOD, balancer->s->lbpname, "0");
     if (lbmethod) {
         balancer->lbmethod = lbmethod;
+        balancer->lbmethod_set = 1;
     } else {
         ap_log_error(APLOG_MARK, APLOG_CRIT, 0, ap_server_conf, APLOGNO(02432)
                      "Cannot find LB Method: %s", balancer->s->lbpname);