From 2b7b21098c034ba25982d348085f0fdbad77dff5 Mon Sep 17 00:00:00 2001 From: Stefan Eissing Date: Tue, 30 Jul 2019 13:11:39 +0000 Subject: [PATCH] Merge r1856829 from trunk: *) mod_proxy: Load balancer byrequests required when bytraffic chosen PR 62372 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1864005 13f79535-47bb-0310-9956-ffa450edef68 --- STATUS | 10 ---------- modules/proxy/proxy_util.c | 7 +++++-- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/STATUS b/STATUS index 5138aeec436..a9d0adcbc27 100644 --- a/STATUS +++ b/STATUS @@ -127,16 +127,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - *) mod_proxy: Load balancer byrequests required when bytraffic chosen - PR 62372 - CHANGES suggestion: - *) mod_proxy_balancer: Load balancer required byrequests when bytraffic chosen. - PR 62372. [Jim Jagielski] - trunk: - http://svn.apache.org/r1856829 - 2.4.x patch: svn merge -c 1856829 ^/httpd/httpd/trunk . - +1: rjung, jim, icing - PATCHES PROPOSED TO BACKPORT FROM TRUNK: [ New proposals should be added at the end of the list ] diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index 48ef2921df9..0315668296e 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -1172,11 +1172,11 @@ PROXY_DECLARE(char *) ap_proxy_define_balancer(apr_pool_t *p, * 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 *)); (*balancer)->gmutex = NULL; (*balancer)->tmutex = NULL; - (*balancer)->lbmethod = lbmethod; if (do_malloc) bshared = ap_malloc(sizeof(proxy_balancer_shared)); @@ -1190,6 +1190,8 @@ PROXY_DECLARE(char *) ap_proxy_define_balancer(apr_pool_t *p, 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 @@ -1244,6 +1246,7 @@ PROXY_DECLARE(apr_status_t) ap_proxy_share_balancer(proxy_balancer *balancer, 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); -- 2.47.3