Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 54142 invoked from network); 25 Apr 2005 21:47:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 25 Apr 2005 21:47:25 -0000 Received: (qmail 41929 invoked by uid 500); 25 Apr 2005 21:47:54 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 41649 invoked by uid 500); 25 Apr 2005 21:47:52 -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 41636 invoked by uid 99); 25 Apr 2005 21:47:52 -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 ns.trellick.net (HELO knee.trellick.net) (217.199.179.115) by apache.org (qpsmtpd/0.28) with ESMTP; Mon, 25 Apr 2005 14:47:52 -0700 X-ClientAddr: 200.121.247.134 Received: from [192.168.1.65] (client-200.121.247.134.speedy.net.pe [200.121.247.134] (may be forged)) (authenticated bits=0) by knee.trellick.net (8.12.10/8.12.10) with ESMTP id j3PLlHxN010927 for ; Mon, 25 Apr 2005 21:47:19 GMT Mime-Version: 1.0 (Apple Message framework v622) In-Reply-To: <200504252327.31142@news.perlig.de> References: <494a720a62e70d1f043753fcf957c18d@ricilake.net> <200504252327.31142@news.perlig.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Message-Id: Content-Transfer-Encoding: quoted-printable From: Rici Lake Subject: Re: For review: teach mod_include.c to recycle brigades Date: Mon, 25 Apr 2005 16:47:04 -0500 To: dev@httpd.apache.org X-Mailer: Apple Mail (2.622) X-trellick.net-MailScanner-Information: Please contact the ISP for more information X-trellick.net-MailScanner: Found to be clean X-MailScanner-From: rici@ricilake.net X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On 25-Apr-05, at 4:27 PM, Andr=E9 Malo wrote: > * Rici Lake wrote: > > +1 in general, but ... > > > ...put it into the internal structure, please. That's I've created it=20= > for > (binary compat and only making stuff public what matters the public). > > nd > --=20 >>>> Muschelflucht-Zusatzeinrichtung. >>> Shell-Escape ist ja noch klar, aber `Zusatzeinrichtung'? >> extension? > Feature. -- gefunden in de.org.ccc Oops, sorry. Revised patch, includes both the bug fix and the recycling=20= of bucket brigades, and still insufficiently tested. Also includes an=20 explicit cleanup, while we continue thrashing out that issue. (nd -- do=20= you have a test suite, by any chance?) Index: mod_include.c =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 --- mod_include.c (revision 158730) +++ mod_include.c (working copy) @@ -173,6 +173,7 @@ apr_size_t bytes_read; apr_bucket_brigade *tmp_bb; + apr_bucket_brigade *pass_bb; request_rec *r; const char *start_seq; @@ -3060,7 +3061,7 @@ struct ssi_internal_ctx *intern =3D ctx->intern; request_rec *r =3D f->r; apr_bucket *b =3D APR_BRIGADE_FIRST(bb); - apr_bucket_brigade *pass_bb; + apr_bucket_brigade *pass_bb =3D intern->pass_bb; apr_status_t rv =3D APR_SUCCESS; char *magic; /* magic pointer for sentinel use */ @@ -3076,9 +3077,6 @@ return ap_pass_brigade(f->next, bb); } - /* All stuff passed along has to be put into that brigade */ - pass_bb =3D apr_brigade_create(ctx->pool, f->c->bucket_alloc); - /* initialization for this loop */ intern->bytes_read =3D 0; intern->error =3D 0; @@ -3145,7 +3143,6 @@ if (!APR_BRIGADE_EMPTY(pass_bb)) { rv =3D ap_pass_brigade(f->next, pass_bb); if (rv !=3D APR_SUCCESS) { - apr_brigade_destroy(pass_bb); return rv; } } @@ -3170,7 +3167,7 @@ } if (rv !=3D APR_SUCCESS) { - apr_brigade_destroy(pass_bb); + apr_brigade_cleanup(pass_bb); return rv; } @@ -3384,7 +3381,7 @@ DEBUG_INIT(ctx, f, pass_bb); rv =3D handle_func(ctx, f, pass_bb); if (rv !=3D APR_SUCCESS) { - apr_brigade_destroy(pass_bb); + apr_brigade_cleanup(pass_bb); return rv; } } @@ -3450,13 +3447,14 @@ /* if something's left over, pass it along */ if (!APR_BRIGADE_EMPTY(pass_bb)) { + /* return ap_pass_brigade(f->next, pass_bb); */ rv =3D ap_pass_brigade(f->next, pass_bb); + apr_brigade_cleanup(pass_bb); + return rv; } else { - rv =3D APR_SUCCESS; - apr_brigade_destroy(pass_bb); + return APR_SUCCESS; } - return rv; } @@ -3542,8 +3540,10 @@ intern->end_seq_len =3D strlen(intern->end_seq); intern->undefined_echo =3D conf->undefined_echo; intern->undefined_echo_len =3D strlen(conf->undefined_echo); - } + /* Initialize the pass brigade */ + intern->pass_bb =3D apr_brigade_create(f->r->pool,=20 f->c->bucket_alloc); + if ((parent =3D ap_get_module_config(r->request_config,=20 &include_module))) { /* Kludge --- for nested includes, we want to keep the=20 subprocess * environment of the base document (for compatibility); that=20= means @@ -3599,6 +3599,7 @@ apr_table_setn(r->subprocess_env, "QUERY_STRING_UNESCAPED", ap_escape_shell_cmd(r->pool, arg_copy)); } + } return send_parsed_content(f, b); }