Hiya folks, just wondering what impact (if any) these changes I've been
working on would have on mod_perl and filters implemented using
mod_perl?

The change is simply that after calling ap_pass_brigade() on a brigade,
any subsequent use of that brigade is likely to segfault since the
brigade structure really is free'd.

I notice the mod_perl pass_brigade documentation includes the necessary
"caller relinquishes ownership" caveat:

http://perl.apache.org/docs/2.0/api/Apache/Filter.html#C_pass_brigade_

but the example there processes the brigade both before and after it's
passed; is that a doc mistake, or do you really expect to be able to do
that in mod_perl?

      # ... process $bb
      
      my $rc = $f->next->pass_brigade($bb);
      return $rc unless $rc == APR::SUCCESS;
      
      # process $bb
      return Apache::OK;

Regards,

joe (please CC me on replies)

----- Forwarded message from Joe Orton <[EMAIL PROTECTED]> -----

From: Joe Orton <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Mail-Followup-To: [EMAIL PROTECTED]
Date: Thu, 17 Jun 2004 10:46:37 +0100
Subject: destroying passed brigades
User-Agent: Mutt/1.4.1i

Any further thoughts on this, Cliff or anyone else?  At least the
core_output_filter, the byterange filter, and the http_header filter
will all destroy the brigade which is passed to them.  Many other
filters presume that it's OK to reuse brigades which have been passed
on.

With a combination of filters which assume both ways, it is inevitable
that changing apr_brigade_destroy() to actually destroy the brigade
structure will break some set of existing filters, unfortunately.

There's also ambiguity about what to do with a passed brigade if the
next filter returns an error.

joe

----- End forwarded message -----

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to