Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 86983 invoked from network); 17 Sep 2008 14:24:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Sep 2008 14:24:35 -0000 Received: (qmail 20825 invoked by uid 500); 17 Sep 2008 14:24:32 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 20776 invoked by uid 500); 17 Sep 2008 14:24:31 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 20767 invoked by uid 99); 17 Sep 2008 14:24:31 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2008 07:24:31 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2008 14:23:41 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 1DDC7238889D; Wed, 17 Sep 2008 07:23:44 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r696316 - in /httpd/httpd/branches/2.2.x: CHANGES docs/manual/mod/mod_proxy.xml include/ap_mmn.h modules/proxy/mod_proxy.c modules/proxy/mod_proxy.h modules/proxy/proxy_util.c Date: Wed, 17 Sep 2008 14:23:39 -0000 To: cvs@httpd.apache.org From: jim@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080917142344.1DDC7238889D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jim Date: Wed Sep 17 07:23:35 2008 New Revision: 696316 URL: http://svn.apache.org/viewvc?rev=696316&view=rev Log: * mod_proxy: Add the possibility to set a separate connection timeout for backend workers. PR: 45445 Trunk version of patch: http://svn.apache.org/viewvc?rev=684341&view=rev Backport version for 2.2.x of patch: Trunk version of patch works, but http://people.apache.org/~rpluem/patches/37770_2.2.x.diff fixes a conflict regarding the needed minor bump. +1: rpluem, jim, jerenkrantz Modified: httpd/httpd/branches/2.2.x/CHANGES httpd/httpd/branches/2.2.x/docs/manual/mod/mod_proxy.xml httpd/httpd/branches/2.2.x/include/ap_mmn.h httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.c httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.h httpd/httpd/branches/2.2.x/modules/proxy/proxy_util.c Modified: httpd/httpd/branches/2.2.x/CHANGES URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/CHANGES?rev=696316&r1=696315&r2=696316&view=diff ============================================================================== --- httpd/httpd/branches/2.2.x/CHANGES [utf-8] (original) +++ httpd/httpd/branches/2.2.x/CHANGES [utf-8] Wed Sep 17 07:23:35 2008 @@ -18,6 +18,10 @@ *) mod_ssl: Rewrite shmcb to avoid memory alignment issues. PR 42101. [Geoff Thorpe] + *) mod_proxy_http: Introduce environment variable proxy-initial-not-pooled to + avoid reusing pooled connections if the client connection is an initial + connection. PR 37770. [Ruediger Pluem] + *) mod_dav_fs: Retrieve minimal system information about directory entries when walking a DAV fs, resolving a performance degradation on Windows. PR 45464. [Joe Orton, Jeff Trawick] Modified: httpd/httpd/branches/2.2.x/docs/manual/mod/mod_proxy.xml URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/docs/manual/mod/mod_proxy.xml?rev=696316&r1=696315&r2=696316&view=diff ============================================================================== --- httpd/httpd/branches/2.2.x/docs/manual/mod/mod_proxy.xml (original) +++ httpd/httpd/branches/2.2.x/docs/manual/mod/mod_proxy.xml Wed Sep 17 07:23:35 2008 @@ -689,6 +689,12 @@ connections in the pool the Apache will return SERVER_BUSY status to the client. + connectiontimeout + timeout + Connect timeout in seconds. + The number of seconds Apache waits for the creation of a connection to + the backend to complete. + disablereuse Off This parameter should be used when you want to force mod_proxy Modified: httpd/httpd/branches/2.2.x/include/ap_mmn.h URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/include/ap_mmn.h?rev=696316&r1=696315&r2=696316&view=diff ============================================================================== --- httpd/httpd/branches/2.2.x/include/ap_mmn.h (original) +++ httpd/httpd/branches/2.2.x/include/ap_mmn.h Wed Sep 17 07:23:35 2008 @@ -128,6 +128,8 @@ * structure * 20051115.15(2.2.9) Add interpolate_env to proxy_dir_conf and * introduce proxy_req_conf. + * 20051115.16(2.2.9) Add conn_timeout and conn_timeout_set to + * proxy_worker struct. * */ @@ -136,7 +138,7 @@ #ifndef MODULE_MAGIC_NUMBER_MAJOR #define MODULE_MAGIC_NUMBER_MAJOR 20051115 #endif -#define MODULE_MAGIC_NUMBER_MINOR 15 /* 0...n */ +#define MODULE_MAGIC_NUMBER_MINOR 16 /* 0...n */ /** * Determine if the server's current MODULE_MAGIC_NUMBER is at least a Modified: httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.c URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.c?rev=696316&r1=696315&r2=696316&view=diff ============================================================================== --- httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.c (original) +++ httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.c Wed Sep 17 07:23:35 2008 @@ -275,6 +275,16 @@ worker->ping_timeout = apr_time_from_sec(ival); worker->ping_timeout_set = 1; } + else if (!strcasecmp(key, "connectiontimeout")) { + /* Request timeout in seconds. + * Defaults to connection timeout + */ + ival = atoi(val); + if (ival < 1) + return "Connectiontimeout must be at least one second."; + worker->conn_timeout = apr_time_from_sec(ival); + worker->conn_timeout_set = 1; + } else { return "unknown Worker parameter"; } Modified: httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.h URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.h?rev=696316&r1=696315&r2=696316&view=diff ============================================================================== --- httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.h (original) +++ httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy.h Wed Sep 17 07:23:35 2008 @@ -355,6 +355,8 @@ char retry_set; char disablereuse; char disablereuse_set; + apr_interval_time_t conn_timeout; + char conn_timeout_set; }; /* Modified: httpd/httpd/branches/2.2.x/modules/proxy/proxy_util.c URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/proxy/proxy_util.c?rev=696316&r1=696315&r2=696316&view=diff ============================================================================== --- httpd/httpd/branches/2.2.x/modules/proxy/proxy_util.c (original) +++ httpd/httpd/branches/2.2.x/modules/proxy/proxy_util.c Wed Sep 17 07:23:35 2008 @@ -2329,8 +2329,11 @@ "Failed to set"); } - /* Set a timeout on the socket */ - if (worker->timeout_set == 1) { + /* Set a timeout for connecting to the backend on the socket */ + if (worker->conn_timeout_set) { + apr_socket_timeout_set(newsock, worker->conn_timeout); + } + else if (worker->timeout_set == 1) { apr_socket_timeout_set(newsock, worker->timeout); } else if (conf->timeout_set == 1) { @@ -2368,6 +2371,17 @@ continue; } + /* Set a timeout on the socket */ + if (worker->timeout_set == 1) { + apr_socket_timeout_set(newsock, worker->timeout); + } + else if (conf->timeout_set == 1) { + apr_socket_timeout_set(newsock, conf->timeout); + } + else { + apr_socket_timeout_set(newsock, s->timeout); + } + conn->sock = newsock; connected = 1; }