From: Jim Jagielski Date: Fri, 19 Sep 2008 13:43:48 +0000 (+0000) Subject: Allow for the smax param to be 0, so that all connections X-Git-Tag: 2.3.0~293 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4a268cc90a731d9642c548d63716e2aec6e11aa0;p=apache Allow for the smax param to be 0, so that all connections are available to be dropped, should they be idle long enough. PR 43371 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@697093 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index eaf549230e..2b2a7afbfb 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,11 @@ Changes with Apache 2.3.0 [ When backported to 2.2.x, remove entry from this file ] + *) Allow for smax to be 0 for balancer members so that all idle + connections are able to be dropped should they exceed ttl. + PR 43371 [Phil Endecott , + Jim Jagielski] + *) mod_proxy_ajp: Fix wrongly formatted requests where client sets Content-Length header, but doesn't provide a body. Servlet container always expects that next packet is diff --git a/modules/proxy/mod_proxy.c b/modules/proxy/mod_proxy.c index 1b2573ac3d..4eef8763eb 100644 --- a/modules/proxy/mod_proxy.c +++ b/modules/proxy/mod_proxy.c @@ -98,7 +98,7 @@ static const char *set_worker_param(apr_pool_t *p, } else if (!strcasecmp(key, "ttl")) { /* Time in seconds that will destroy all the connections - * that exced the smax + * that exceed the smax */ ival = atoi(val); if (ival < 1) diff --git a/modules/proxy/proxy_util.c b/modules/proxy/proxy_util.c index fd46206ebe..1a150eafdd 100644 --- a/modules/proxy/proxy_util.c +++ b/modules/proxy/proxy_util.c @@ -1435,6 +1435,7 @@ PROXY_DECLARE(const char *) ap_proxy_add_worker(proxy_worker **worker, (*worker)->id = proxy_lb_workers; (*worker)->flush_packets = flush_off; (*worker)->flush_wait = PROXY_FLUSH_WAIT; + (*worker)->smax = -1; /* Increase the total worker count */ proxy_lb_workers++; init_conn_pool(p, *worker); @@ -1455,6 +1456,7 @@ PROXY_DECLARE(proxy_worker *) ap_proxy_create_worker(apr_pool_t *p) proxy_worker *worker; worker = (proxy_worker *)apr_pcalloc(p, sizeof(proxy_worker)); worker->id = proxy_lb_workers; + worker->smax = -1; /* Increase the total worker count */ proxy_lb_workers++; init_conn_pool(p, worker); @@ -1920,7 +1922,7 @@ PROXY_DECLARE(apr_status_t) ap_proxy_initialize_worker(proxy_worker *worker, ser if (worker->hmax == 0 || worker->hmax > mpm_threads) { worker->hmax = mpm_threads; } - if (worker->smax == 0 || worker->smax > worker->hmax) { + if (worker->smax == -1 || worker->smax > worker->hmax) { worker->smax = worker->hmax; } /* Set min to be lower then smax */