
lars at skjaerlund
Dec 6, 2008, 10:44 PM
Post #1 of 2
(457 views)
Permalink
|
|
Apache2 / FilterRequestHandler oddity
|
|
Hi everyone, I'm having a rather odd problem that I cannot figure out how to solve: I've created a mod_perl2 output filter, but my mod_perl2 installation won't load it - complaining something like Can't add request filter handler 'Eremita::Test::handler' since it doesn't have the FilterRequestHandler attribute set The same code runs fine at other machines. The machine in question is running openSUSE 11.0 / Apache 2.2.8 / mod_perl2 2.0.4-dev. My current test code looks like this: package Eremita::Test; use strict; use warnings FATAL => 'all'; our $VERSION = 0.01; use base qw(Apache2::Filter); use Apache2::RequestRec (); use APR::Table (); use Apache2::Const -compile => qw(DECLINED HTTP_INTERNAL_SERVER_ERROR OK); use APR::Const -compile => ':common'; use constant BUFF_LEN => 1024; sub handler : FilterRequestHandler { my $f = shift; unless ($f->ctx) { $f->r->headers_out->unset('Content-Length'); $f->ctx(1); } while ($f->read(my $buffer, BUFF_LEN)) { $buffer =~ s/[\r\n]//g; $f->print($buffer); } return Apache2::Const::OK; } 1; Googling doesn't reveal much - any hints? Regards, Lars -- Lars Skjærlund Skovengen 111 2980 Kokkedal Denmark Tlf.: +45 70258810 http://www.skjaerlund.dk/lars
|