You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Fred Moyer <fr...@redhotpenguin.com> on 2008/02/20 20:44:35 UTC

$r->add_output_filter using core filters

Greetings,

Is it possible to dynamically add core output filters such as INCLUDE with
$r->add_output_filter('INCLUDE')?  The docs indicate that
PerlSetOutputFilter INCLUDE is ok, but it looks like $r->add_output_filter
is restricted to perl handlers.  I tried add_output_filter with INCLUDE,
but received an error saying no such handler.

Thanks,

Fred


Re: $r->add_output_filter using core filters

Posted by Torsten Foertsch <to...@gmx.net>.
Hi Fred,

On Wed 20 Feb 2008, Fred Moyer wrote:
> Is it possible to dynamically add core output filters such as INCLUDE with
> $r->add_output_filter('INCLUDE')?  The docs indicate that
> PerlSetOutputFilter INCLUDE is ok, but it looks like $r->add_output_filter
> is restricted to perl handlers.  I tried add_output_filter with INCLUDE,
> but received an error saying no such handler.

Some years ago (~2004) I have digged into that and found it's not possible. 
But you can remove C-level filters (my 1st contribution I think). So you can 
add them first and then remove them for requests that don't need them. It is 
not complicated to write a filter that removes the next filter in the filter 
chain if some condition is met.

Torsten