Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@www.apache.org Received: (qmail 83570 invoked from network); 3 Aug 2004 20:29:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 3 Aug 2004 20:29:23 -0000 Received: (qmail 67645 invoked by uid 500); 3 Aug 2004 20:29:10 -0000 Delivered-To: apmail-jakarta-tomcat-dev-archive@jakarta.apache.org Received: (qmail 67435 invoked by uid 500); 3 Aug 2004 20:29:08 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Developers List" Reply-To: "Tomcat Developers List" Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 67422 invoked by uid 500); 3 Aug 2004 20:29:08 -0000 Received: (qmail 67419 invoked by uid 99); 3 Aug 2004 20:29:08 -0000 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.27.1) with SMTP; Tue, 03 Aug 2004 13:29:07 -0700 Received: (qmail 83469 invoked by uid 1526); 3 Aug 2004 20:29:07 -0000 Date: 3 Aug 2004 20:29:07 -0000 Message-ID: <20040803202907.83468.qmail@minotaur.apache.org> From: mturk@apache.org To: jakarta-tomcat-connectors-cvs@apache.org Subject: cvs commit: jakarta-tomcat-connectors/ajp/proxy mod_proxy.c X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N mturk 2004/08/03 13:29:07 Modified: ajp/proxy mod_proxy.c Log: Added init_conn_pool to worker. Connection pool will either use reslist (if thread number > 1) or single connection. Revision Changes Path 1.11 +36 -0 jakarta-tomcat-connectors/ajp/proxy/mod_proxy.c Index: mod_proxy.c =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/ajp/proxy/mod_proxy.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- mod_proxy.c 3 Aug 2004 19:56:18 -0000 1.10 +++ mod_proxy.c 3 Aug 2004 20:29:07 -0000 1.11 @@ -20,6 +20,7 @@ #include "mod_core.h" #include "apr_optional.h" +#include "ap_mpm.h" #if (MODULE_MAGIC_NUMBER_MAJOR > 20020903) #include "mod_ssl.h" @@ -1366,6 +1367,39 @@ return NULL; } +static void init_conn_pool(apr_pool_t *p, proxy_worker *worker) +{ + apr_pool_t *pool; + proxy_conn_pool *cp; + + /* Create a connection pool's subpool */ + apr_pool_create(&pool, p); + cp = (proxy_conn_pool *)apr_pcalloc(pool, sizeof(proxy_conn_pool)); + cp->pool = pool; +#if APR_HAS_THREADS + { + int mpm_threads; + ap_mpm_query(AP_MPMQ_MAX_THREADS, &mpm_threads); + if (mpm_threads > 1) { + /* Set hard max to no more then mpm_threads */ + if (worker->hmax == 0 || worker->hmax > mpm_threads) + worker->hmax = mpm_threads; + if (worker->smax == 0 || worker->smax > worker->hmax) + worker->smax = worker->hmax; + /* Set min to be lower then smax */ + if (worker->min > worker->smax) + worker->min = worker->smax; + } + else { + /* This will supress the apr_reslist creation */ + worker->min = worker->smax = worker->hmax = 0; + } + } +#endif + + worker->cp = cp; +} + PROXY_DECLARE(const char *) ap_proxy_add_worker(proxy_worker **worker, apr_pool_t *p, proxy_server_conf *conf, @@ -1398,6 +1432,8 @@ if (port == -1) port = apr_uri_port_of_scheme((*worker)->scheme); (*worker)->port = port; + + init_conn_pool(p, *worker); return NULL; } --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org