Re: Activating/decativating PerlOutputFilterHandler "on-the-fly"

[prev] [thread] [next] [Date index for 2005/05/02]

From: Jeff Ambrosino
Subject: Re: Activating/decativating PerlOutputFilterHandler "on-the-fly"
Date: 22:39 on 02 May 2005
From within an existing Perl handler/filter, you can dynamically
insert ('register') a new filter with the add_output_filter method on
the request object:

$r->add_output_filter(\&callback);

And, you can remove a downstream filter (from within an upstream filter) wi=
th:

$next_f =3D $f->next;
$next_f->remove;

...or even any subsequent invocations of the current filter (i.e., for
the current request) with:

$f->remove;

n.b. I'm not sure if it is possible to remove a downstream filter from
within a handler, since it appears you need the $f (filter) object to
do a remove... (can one reference the filter object from the request
object?)

For more explanation that will probably put you on the right track, see:
http://perl.apache.org/docs/2.0/api/Apache/Filter.html

cheers
Jeff

On 5/2/05, Srebrenko Sehic <haver@xxxxxxxx.xx> wrote:
> Hi ppl,
>=20
> I have a couple of PerlOutputFilterHandler directives registered in my
> httpd.conf <VirtualHost> conigurations.
>=20
> Is there any way to activate/deactivate these filters without editing
> httpd.conf and restarting Apache?
>=20
> I'm running Apache 2.0.54 with mod_perl2_RC5.
>=20
> TIA,
>=20
> // haver
>

Re: Activating/decativating PerlOutputFilterHandler "on-the-fly"
Jeff Ambrosino 22:39 on 02 May 2005

Generated at 10:25 on 04 May 2005 by mariachi v0.52