httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Schaefer <joe+gm...@sunstarsys.com>
Subject Re: Recall of input filter module on completion of output filterprocessing for a request???
Date Tue, 31 Aug 2004 03:23:04 GMT
Bojan Smojver <bojan@rexursive.com> writes:

> What I had a problem with (and this is why I asked this) is the lifetime
> of pools. Brigades (and the buckets within them) that go through filters
> should have (at least) connection lifetime, 

I agree wrt "buckets", but are you certain about the "brigades" part?
I can tell you that it is not a good idea to have a perl-request input
filter create a per-connection brigade: because the brigade's pool 
cleanup won't delete any internal buckets until the connection closes, 
thereby introducing per-request memory leaks.

I suspect the reasoning is more-or-less identical on the output filter
side, *except* for the brigade you hand off to ap_pass_brigade(),
because of this cryptic statement in the ap_pass_brigade docs:

    "The caller relinquishes ownership of the brigade"

Do you have any idea what sort "ownership" they're talking about? I can 
think of a few interpretations:

  1)  pointers are invalid (the brigade itself may have been freed),
  2)  the brigade may not be modified by the caller ever again,
  3)  the brigade may not be modified by the caller again, during the
      rest of this call.

> not request lifetime.  Otherwise, the memory area you are referencing
> may be released/overwritten by the time the network connection filter
> gets to actually serving the request (which is not necessarily at the
> end of the request). Once I made sure that everything I put into the
> brigade has connection lifetime, all was fine.

Here your talking about the "buckets" in the brigade, not the 
brigade itself, right?  (If so, I totally agree with you).

-- 
Joe Schaefer


Mime
View raw message