Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 62810 invoked from network); 27 Jan 2005 17:23:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 27 Jan 2005 17:23:35 -0000 Received: (qmail 58046 invoked by uid 500); 27 Jan 2005 17:23:26 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 58008 invoked by uid 500); 27 Jan 2005 17:23:26 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 57916 invoked by uid 99); 27 Jan 2005 17:23:25 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from chandler.sharp.fm (HELO chandler.sharp.fm) (64.49.223.165) by apache.org (qpsmtpd/0.28) with ESMTP; Thu, 27 Jan 2005 09:23:23 -0800 Received: by chandler.sharp.fm (Postfix, from userid 48) id 00994923453; Thu, 27 Jan 2005 11:23:20 -0600 (CST) Received: from 196.8.104.27 (SquirrelMail authenticated user minfrin@sharp.fm); by www.sharp.fm with HTTP; Thu, 27 Jan 2005 19:23:20 +0200 (SAST) Message-ID: <13139.196.8.104.27.1106846600.squirrel@www.sharp.fm> In-Reply-To: <1106846174.12782.160.camel@dragon.cnet.cnwk.com> References: <1106846174.12782.160.camel@dragon.cnet.cnwk.com> Date: Thu, 27 Jan 2005 19:23:20 +0200 (SAST) Subject: Re: Small leak in mod_proxy? From: "Graham Leggett" To: dev@httpd.apache.org User-Agent: SquirrelMail/1.4.3a-7.EL3 X-Mailer: SquirrelMail/1.4.3a-7.EL3 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Ronald Park said: > I was looking at mod_proxy and I'm not sure if this is a leak or not. > Well, it's surely not a leak since it's all pool-based, but it might > be made a little cleaner... > > In proxy_http.c, ap_proxy_http_request() around line 627 it says: > > /* If this brigade contain EOS, either stop or remove it. */ > if (APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(bb))) { > /* As a shortcut, if this brigade is simply an EOS bucket, > * don't send anything down the filter chain. > */ > if (APR_BUCKET_IS_EOS(APR_BRIGADE_FIRST(bb))) { > break; > } > > This break makes it skip the apr_brigade_cleanup(bb) call at the end > of the do loop. Shouldn't it cleanup this EOS brigade? All apr_brigade_cleanup does is empty out a brigade so that it can be reused - this is more efficient than recreating a brigade from scratch. In theory if I am reading this right, the break will happen if the end of stream is encountered. Here it makes no sense to cleanup the brigade separately, as the entire pool is about to get destroyed, the brigade and it's old contents along with it. Regards, Graham --