FilterHasInitHandler not working

Joachim Zobel <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Organization Not organized
Message-ID <[email protected]>
Hi.

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?

Sincerely,
Joachim

.htaccess------------------------------------------------------
PerlModule TestInit

# The html file is arbitrary
<Files test6.html>
    SetHandler modperl
    PerlOutputFilterHandler TestInit 
</Files>
TestInit.pm----------------------------------------------------
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.");
  $filter->ctx(1);
}

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;
}

1;
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.