Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 50878 invoked from network); 26 Feb 2005 09:04:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 26 Feb 2005 09:04:17 -0000 Received: (qmail 44068 invoked by uid 500); 26 Feb 2005 09:04:17 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 44030 invoked by uid 500); 26 Feb 2005 09:04:16 -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: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 44014 invoked by uid 99); 26 Feb 2005 09:04:16 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Sat, 26 Feb 2005 01:04:16 -0800 Received: (qmail 50847 invoked by uid 65534); 26 Feb 2005 09:04:14 -0000 Message-ID: <20050226090414.50846.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Mailer: svnmailer-1.0.0-dev Date: Sat, 26 Feb 2005 09:04:14 -0000 Subject: svn commit: r155391 - in httpd/httpd/branches/2.0.x: CHANGES STATUS include/httpd.h server/core.c To: cvs@httpd.apache.org From: pquerna@apache.org X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Author: pquerna Date: Sat Feb 26 01:04:10 2005 New Revision: 155391 URL: http://svn.apache.org/viewcvs?view=3Drev&rev=3D155391 Log: core_input_filter: Stop leaking a brigade by moving buckets to an existing = brigade instead of calling brigade_split. PR: 33382 Reviewed By: Justin Erenkrantz, Jeff Trawick Modified: httpd/httpd/branches/2.0.x/CHANGES httpd/httpd/branches/2.0.x/STATUS httpd/httpd/branches/2.0.x/include/httpd.h httpd/httpd/branches/2.0.x/server/core.c Modified: httpd/httpd/branches/2.0.x/CHANGES URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.0.x/CHANGES?view= =3Ddiff&r1=3D155390&r2=3D155391 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- httpd/httpd/branches/2.0.x/CHANGES (original) +++ httpd/httpd/branches/2.0.x/CHANGES Sat Feb 26 01:04:10 2005 @@ -1,5 +1,9 @@ Changes with Apache 2.0.54 =20 + *) core_input_filter: Move buckets to a persistent brigade instead of + creating a new brigade. This stop a memory leak when proxying a=20 + Streaming Media Server. PR 33382. [Paul Querna] + *) mod_win32: Ignore both PATH_INFO as well as PATH_TRANSLATED to avoid=20 hiccups from additional path information passed in non-utf-8 format. [Richard Donkin user from SSLUsername earlier so that it's actually useful. http://svn.apache.org/viewcvs.cgi?rev=3D153280&view=3Drev Modified: httpd/httpd/branches/2.0.x/include/httpd.h URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.0.x/include/httpd= .h?view=3Ddiff&r1=3D155390&r2=3D155391 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- httpd/httpd/branches/2.0.x/include/httpd.h (original) +++ httpd/httpd/branches/2.0.x/include/httpd.h Sat Feb 26 01:04:10 2005 @@ -1100,6 +1100,7 @@ =20 typedef struct core_filter_ctx { apr_bucket_brigade *b; + apr_bucket_brigade *tmpbb; } core_ctx_t; =20 typedef struct core_net_rec { Modified: httpd/httpd/branches/2.0.x/server/core.c URL: http://svn.apache.org/viewcvs/httpd/httpd/branches/2.0.x/server/core.c= ?view=3Ddiff&r1=3D155390&r2=3D155391 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D --- httpd/httpd/branches/2.0.x/server/core.c (original) +++ httpd/httpd/branches/2.0.x/server/core.c Sat Feb 26 01:04:10 2005 @@ -3674,6 +3674,28 @@ } while (!APR_BRIGADE_EMPTY(b) && (e !=3D APR_BRIGADE_SENTINEL(b))); \ } while (0) =20 + +/** + * Split the contents of a brigade after bucket 'e' to an existing brigade + * + * XXXX: Should this function be added to APR-Util? + */ +static void brigade_move(apr_bucket_brigade *b, apr_bucket_brigade *a, + apr_bucket *e) +{ + apr_bucket *f; =20 + + if (e !=3D APR_BRIGADE_SENTINEL(b)) { + f =3D APR_RING_LAST(&b->list); + APR_RING_UNSPLICE(e, f, link); + APR_RING_SPLICE_HEAD(&a->list, e, f, apr_bucket, link); + } + + APR_BRIGADE_CHECK_CONSISTENCY(a); + APR_BRIGADE_CHECK_CONSISTENCY(b); +} + + static int core_input_filter(ap_filter_t *f, apr_bucket_brigade *b, ap_input_mode_t mode, apr_read_type_e block, apr_off_t readbytes) @@ -3703,6 +3725,7 @@ { ctx =3D apr_pcalloc(f->c->pool, sizeof(*ctx)); ctx->b =3D apr_brigade_create(f->c->pool, f->c->bucket_alloc); + ctx->tmpbb =3D apr_brigade_create(ctx->b->p, ctx->b->bucket_alloc); =20 /* seed the brigade with the client socket. */ e =3D apr_bucket_socket_create(net->client_socket, f->c->bucket_al= loc); @@ -3814,7 +3837,6 @@ /* read up to the amount they specified. */ if (mode =3D=3D AP_MODE_READBYTES || mode =3D=3D AP_MODE_SPECULATIVE) { apr_bucket *e; - apr_bucket_brigade *newbb; =20 AP_DEBUG_ASSERT(readbytes > 0); =20 @@ -3855,8 +3877,8 @@ return rv; } =20 - /* Must do split before CONCAT */ - newbb =3D apr_brigade_split(ctx->b, e); + /* Must do move before CONCAT */ + brigade_move(ctx->b, ctx->tmpbb, e); =20 if (mode =3D=3D AP_MODE_READBYTES) { APR_BRIGADE_CONCAT(b, ctx->b); @@ -3873,7 +3895,7 @@ } =20 /* Take what was originally there and place it back on ctx->b */ - APR_BRIGADE_CONCAT(ctx->b, newbb); + APR_BRIGADE_CONCAT(ctx->b, ctx->tmpbb); } return APR_SUCCESS; }