Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 99726 invoked from network); 11 Nov 2008 20:01:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Nov 2008 20:01:03 -0000 Received: (qmail 78481 invoked by uid 500); 11 Nov 2008 20:01:10 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 78250 invoked by uid 500); 11 Nov 2008 20:01:10 -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 78240 invoked by uid 99); 11 Nov 2008 20:01:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Nov 2008 12:01:10 -0800 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; Tue, 11 Nov 2008 19:59:58 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id DC75A2388995; Tue, 11 Nov 2008 12:00:11 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r713143 - in /httpd/httpd/branches/2.2.x: ./ STATUS docs/ modules/proxy/mod_proxy_http.c support/ab.c support/suexec.c Date: Tue, 11 Nov 2008 20:00:11 -0000 To: cvs@httpd.apache.org From: jim@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20081111200011.DC75A2388995@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jim Date: Tue Nov 11 12:00:10 2008 New Revision: 713143 URL: http://svn.apache.org/viewvc?rev=713143&view=rev Log: Merge r707163 from trunk: Remove potential for memory leak... allocate on this request which is now viable due to connection pooling. Reviewed by: jim Modified: httpd/httpd/branches/2.2.x/ (props changed) httpd/httpd/branches/2.2.x/STATUS httpd/httpd/branches/2.2.x/docs/ (props changed) httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_http.c httpd/httpd/branches/2.2.x/support/ab.c (props changed) httpd/httpd/branches/2.2.x/support/suexec.c (props changed) Propchange: httpd/httpd/branches/2.2.x/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue Nov 11 12:00:10 2008 @@ -1 +1 @@ -/httpd/httpd/trunk:451572,611483,639005,639010,647395,660461,660566,664330,678761,681190,682369,683626,685112,686805,686809,687099,687754,693392,693727-693728,696006,697093,706318,708902,711421 +/httpd/httpd/trunk:451572,611483,639005,639010,647395,660461,660566,664330,678761,681190,682369,683626,685112,686805,686809,687099,687754,693392,693727-693728,696006,697093,706318,707163,708902,711421 Modified: httpd/httpd/branches/2.2.x/STATUS URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/STATUS?rev=713143&r1=713142&r2=713143&view=diff ============================================================================== --- httpd/httpd/branches/2.2.x/STATUS (original) +++ httpd/httpd/branches/2.2.x/STATUS Tue Nov 11 12:00:10 2008 @@ -105,14 +105,6 @@ http://people.apache.org/~rpluem/patches/milli_seconds.diff +1: rpluem, pgollucci, jim - * mod_proxy: Remove potential for memory leak. Allocate from request - pool which is now viable due to connection pooling - Trunk version of patch: - http://svn.apache.org/viewcvs.cgi?rev=707163&view=rev - Backport version for 2.2.x of patch: - Trunk version of patch works - +1: rpluem, jim, pgollucci - PATCHES PROPOSED TO BACKPORT FROM TRUNK: [ New proposals should be added at the end of the list ] Propchange: httpd/httpd/branches/2.2.x/docs/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue Nov 11 12:00:10 2008 @@ -1 +1 @@ -/httpd/httpd/trunk/docs:451572,611483,639005,639010,647395,660461,660566,664330,675610,678761,681190,682369,683626,684351,685112,686549,686805,686809,687099,687754,692325,693392,693727-693728,696006,697093,703441,703997,706318,708902,711421 +/httpd/httpd/trunk/docs:451572,611483,639005,639010,647395,660461,660566,664330,675610,678761,681190,682369,683626,684351,685112,686549,686805,686809,687099,687754,692325,693392,693727-693728,696006,697093,703441,703997,706318,707163,708902,711421 Modified: httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_http.c URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_http.c?rev=713143&r1=713142&r2=713143&view=diff ============================================================================== --- httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_http.c (original) +++ httpd/httpd/branches/2.2.x/modules/proxy/mod_proxy_http.c Tue Nov 11 12:00:10 2008 @@ -1872,23 +1872,13 @@ const char *u; proxy_conn_rec *backend = NULL; int is_ssl = 0; - - /* Note: Memory pool allocation. - * A downstream keepalive connection is always connected to the existence - * (or not) of an upstream keepalive connection. If this is not done then - * load balancing against multiple backend servers breaks (one backend - * server ends up taking 100% of the load), and the risk is run of - * downstream keepalive connections being kept open unnecessarily. This - * keeps webservers busy and ties up resources. - * - * As a result, we allocate all sockets out of the upstream connection - * pool, and when we want to reuse a socket, we check first whether the - * connection ID of the current upstream connection is the same as that - * of the connection when the socket was opened. - */ - apr_pool_t *p = r->connection->pool; conn_rec *c = r->connection; - apr_uri_t *uri = apr_palloc(r->connection->pool, sizeof(*uri)); + /* + * Use a shorter-lived pool to reduce memory usage + * and avoid a memory leak + */ + apr_pool_t *p = r->pool; + apr_uri_t *uri = apr_palloc(p, sizeof(*uri)); /* find the scheme */ u = strchr(url, ':'); @@ -1896,7 +1886,7 @@ return DECLINED; if ((u - url) > 14) return HTTP_BAD_REQUEST; - scheme = apr_pstrndup(c->pool, url, u - url); + scheme = apr_pstrndup(p, url, u - url); /* scheme is lowercase */ ap_str_tolower(scheme); /* is it for us? */ Propchange: httpd/httpd/branches/2.2.x/support/ab.c ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue Nov 11 12:00:10 2008 @@ -1 +1 @@ -/httpd/httpd/trunk/support/ab.c:83751-655654,657433,660461,660566,664330,678761,681190,682369,683626,685112,686805,686809,687099,687754,693392,693727-693728,696006,697093,706318,708902,711421 +/httpd/httpd/trunk/support/ab.c:83751-655654,657433,660461,660566,664330,678761,681190,682369,683626,685112,686805,686809,687099,687754,693392,693727-693728,696006,697093,706318,707163,708902,711421 Propchange: httpd/httpd/branches/2.2.x/support/suexec.c ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue Nov 11 12:00:10 2008 @@ -1 +1 @@ -/httpd/httpd/trunk/support/suexec.c:451572,611483,639005,639010,647395,655711,660461,660566,664330,678761,681190,682369,683626,685112,686805,686809,687099,687754,693392,693727-693728,696006,697093,706318,708902,711421 +/httpd/httpd/trunk/support/suexec.c:451572,611483,639005,639010,647395,655711,660461,660566,664330,678761,681190,682369,683626,685112,686805,686809,687099,687754,693392,693727-693728,696006,697093,706318,707163,708902,711421