Mailing List Archive

FilterHasInitHandler not working

I have a rather straight test (see below) that tells me my
FilterInitHandler is not called.

Am I missing something obvious or is this a bug?


PerlModule TestInit

# The html file is arbitrary
<Files test6.html>
SetHandler modperl
PerlOutputFilterHandler TestInit
use strict;
use warnings;

use Apache2::RequestRec;

use Apache2::Filter;

use APR::Brigade ( );
use APR::Bucket ( );
use APR::BucketType ( );

use Apache2::Log;
use APR::Const -compile => ':common';
#use Apache2::Const;

package TestInit;

use URI;

use base qw(Apache2::Filter);

# Test if filter init is working
sub init: FilterInitHandler {
my($filter) = @_;

$filter->r->log->debug("Init handler will be initialised.");

sub handler: FilterHasInitHandler(\&init) {
my($filter, $bb) = @_;

$filter->r->log->debug("Init test handler called.");
if ($filter->ctx) {
return $filter->next->pass_brigade($bb);
$filter->r->log->error("Init test handler failed.");

# Just says no success (which gives a 500)
return 500;