httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rici Lake <r...@ricilake.net>
Subject Re: RFC: Who owns a passed brigade?
Date Fri, 22 Apr 2005 21:42:04 GMT

On 22-Apr-05, at 9:32 AM, Joe Orton wrote:

> The issue here is really "which party can *destroy* a brigade", right?

Or perhaps "which party *must* destroy a brigade." This is much less of 
an issue if neither party creates a new brigade on every filter 
invocation. But some do.

> In the current code where brigades are never really destroyed the fact
> that apr_brigade_cleanup() is called everywhere is not really harmful,
> is it?

No, what would be harmful would be apr_brigade_cleanup() not being 
called on a non-empty brigade.

> It looked to me like it was going to much simpler to adapt filters
> shipped in httpd to match the creator-must-destroy model, than to match
> a consumer-must-destroy model, despite the ap_pass_brigade docstring.

That seems to be the case.

> It's certainly easier to audit for.

Sure, but it applies equally to buckets. It seems that the consensus is 
"creator-must-destroy-brigades; consumer-must-remove-buckets". That's 
not easy to audit for, which is why I think ap_pass_brigade should 
guarantee the latter condition.

> In creator-must-destroy it is still fine for a consumer to call
> apr_brigade_cleanup() on a brigade it is passed, of course; that's just
> equivalent to consuming all the buckets, after all.

Sure. Consequently, it's ok for ap_pass_brigade to do the call. Then a 
consumer is free to either consume the buckets or not.


Mime
View raw message