httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Erenkrantz <jus...@erenkrantz.com>
Subject Re: Proposed patch: always cleanup brigades in ap_pass_brigade
Date Mon, 25 Apr 2005 18:30:51 GMT
--On Monday, April 25, 2005 12:47 PM -0500 Rici Lake <rici@ricilake.net> 
wrote:

> Regardless of any other changes to the brigade API, this seems to me to
> be a good idea:
>
> Index: util_filter.c
> ===================================================================
> --- util_filter.c       (revision 158730)
> +++ util_filter.c       (working copy)
> @@ -500,6 +500,7 @@
>   AP_DECLARE(apr_status_t) ap_pass_brigade(ap_filter_t *next,
>                                            apr_bucket_brigade *bb)
>   {
> +    apr_status_t result = AP_NOBODY_WROTE;
>       if (next) {
>           apr_bucket *e;
>           if ((e = APR_BRIGADE_LAST(bb)) && APR_BUCKET_IS_EOS(e) &&
> next->r) {
> @@ -523,9 +524,10 @@
>                   }
>               }
>           }
> -        return next->frec->filter_func.out_func(next, bb);
> +        result = next->frec->filter_func.out_func(next, bb);
> +        apr_brigade_cleanup(bb);
>       }
> -    return AP_NOBODY_WROTE;
> +    return result;
>   }

This introduces a really large overhead as we'd be calling the cleanup for 
*every* output filter we invoke.  So, -0.9999.  -- justin


Mime
View raw message