You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Stefan Fritsch <sf...@sfritsch.de> on 2009/10/04 09:37:50 UTC
Re: Memory usage, core output filter, and apr_brigade_destroy
Thanks for your comments.
On Wednesday 23 September 2009, Ruediger Pluem wrote:
> --- modules/http/chunk_filter.c (Revision 818232)
> +++ modules/http/chunk_filter.c (Arbeitskopie)
> @@ -49,11 +49,11 @@
> #define ASCII_CRLF "\015\012"
> #define ASCII_ZERO "\060"
> conn_rec *c = f->r->connection;
> - apr_bucket_brigade *more;
> + apr_bucket_brigade *more, *tmp;
> apr_bucket *e;
> apr_status_t rv;
>
> - for (more = NULL; b; b = more, more = NULL) {
> + for (more = tmp = NULL; b; tmp = b, b = more, more = NULL) {
> apr_off_t bytes = 0;
> apr_bucket *eos = NULL;
> apr_bucket *flush = NULL;
> @@ -85,7 +85,8 @@
> if (APR_BUCKET_IS_FLUSH(e)) {
> flush = e;
> if (e != APR_BRIGADE_LAST(b)) {
> - more = apr_brigade_split(b,
> APR_BUCKET_NEXT(e)); + more =
> apr_brigade_split_ex(b, APR_BUCKET_NEXT(e), tmp); +
> tmp = NULL;
> }
> break;
> }
> @@ -105,7 +106,8 @@
> * block so we pass down what we have so far.
> */
> bytes += len;
> - more = apr_brigade_split(b,
> APR_BUCKET_NEXT(e)); + more =
> apr_brigade_split_ex(b, APR_BUCKET_NEXT(e), tmp); +
> tmp = NULL;
> break;
> }
> else {
>
> What is the point here? tmp is always NULL when passed to
> apr_brigade_split_ex so apr_brigade_split_ex == apr_brigade_split
You missed the tmp = b at the beginning of the loop. The tmp = NULL
lines were actually not needed. I have changed this a bit to hopefully
make it clearer and commited the patch together with the other changes
you suggested.
Cheers,
Stefan
Re: Memory usage, core output filter, and apr_brigade_destroy
Posted by Ruediger Pluem <rp...@apache.org>.
On 10/04/2009 09:37 AM, Stefan Fritsch wrote:
> Thanks for your comments.
>
> On Wednesday 23 September 2009, Ruediger Pluem wrote:
>>
>> What is the point here? tmp is always NULL when passed to
>> apr_brigade_split_ex so apr_brigade_split_ex == apr_brigade_split
>
> You missed the tmp = b at the beginning of the loop. The tmp = NULL
> lines were actually not needed. I have changed this a bit to hopefully
> make it clearer and commited the patch together with the other changes
> you suggested.
Yes, I missed that. Thanks for explaining.
Regards
RĂ¼diger