Return-Path: X-Original-To: apmail-httpd-cvs-archive@www.apache.org Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id ED8FB9722 for ; Sat, 5 May 2012 08:31:03 +0000 (UTC) Received: (qmail 76688 invoked by uid 500); 5 May 2012 08:31:03 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 76498 invoked by uid 500); 5 May 2012 08:31:02 -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 76477 invoked by uid 99); 5 May 2012 08:31:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 05 May 2012 08:31:01 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.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; Sat, 05 May 2012 08:30:59 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id C7A6D2388978; Sat, 5 May 2012 08:30:39 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1334343 - in /httpd/httpd/trunk: CHANGES modules/proxy/mod_proxy_ajp.c Date: Sat, 05 May 2012 08:30:39 -0000 To: cvs@httpd.apache.org From: sf@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120505083039.C7A6D2388978@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sf Date: Sat May 5 08:30:39 2012 New Revision: 1334343 URL: http://svn.apache.org/viewvc?rev=1334343&view=rev Log: Use short lived pool to avoid memory leaks Remove the comment about binding upstream and downstream connections. It seems to be obsolete since r104604, r104605, r105108. Also avoid allocating memory if we are not handling the connection. PR: 52275 Submitted by: Naohiro Ooiwa , Stefan Fritsch Modified: httpd/httpd/trunk/CHANGES httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c Modified: httpd/httpd/trunk/CHANGES URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1334343&r1=1334342&r2=1334343&view=diff ============================================================================== --- httpd/httpd/trunk/CHANGES [utf-8] (original) +++ httpd/httpd/trunk/CHANGES [utf-8] Sat May 5 08:30:39 2012 @@ -1,6 +1,9 @@ -*- coding: utf-8 -*- Changes with Apache 2.5.0 + *) mod_proxy_ajp: Reduce memory usage in case of many keep-alive requests on + one connection. PR 52275. [Naohiro Ooiwa ] + *) mod_proxy: Use the the same hostname for SNI as for the HTTP request when forwarding to SSL backends. PR 53134. [Michael Weiser , Ruediger Pluem] Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c?rev=1334343&r1=1334342&r2=1334343&view=diff ============================================================================== --- httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c (original) +++ httpd/httpd/trunk/modules/proxy/mod_proxy_ajp.c Sat May 5 08:30:39 2012 @@ -701,29 +701,15 @@ static int proxy_ajp_handler(request_rec int retry; proxy_dir_conf *dconf = ap_get_module_config(r->per_dir_config, &proxy_module); - - /* - * 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; - apr_uri_t *uri = apr_palloc(r->connection->pool, sizeof(*uri)); - + apr_pool_t *p = r->pool; + apr_uri_t *uri; if (strncasecmp(url, "ajp:", 4) != 0) { ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(00894) "declining URL %s", url); return DECLINED; } + + uri = apr_palloc(p, sizeof(*uri)); ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(00895) "serving URL %s", url); /* create space for state information */