httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Graham Leggett" <>
Subject Re: Small leak in mod_proxy?
Date Thu, 27 Jan 2005 17:23:20 GMT
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.


View raw message