perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joachim Zobel <jzo...@heute-morgen.de>
Subject FilterHasInitHandler not working
Date Tue, 29 May 2012 04:21:26 GMT
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;





Mime
View raw message