Perlrequire /opt/code/scripts/apache2-perl-startup.pl
...
PerlOutputFilterHandler ZCRM::OFilter::output
PerlInputFilterHandler ZCRM::OFilter::input
####
package ZCRM::OFilter;
use strict;
use warnings;
use Apache2::Filter ();
use Apache2::RequestRec ();
use Apache2::Const -compile => qw(OK DECLINED MODE_READBYTES);
use APR::Const -compile => qw(SUCCESS BLOCK_READ);
use Apache2::Connection ();
use constant IOBUFSIZE => 8192;
use strict;
sub output {
my $f = shift;
my $r = $f->r;
while ( $f->read( my $buffer, 1024 ) ) {
# do work on $buffer...
$f->print($buffer);
}
return Apache2::Const::OK;
}
sub input {
my $r = shift;
my $bb = APR::Brigade->new( $r->pool, $r->connection->bucket_alloc ); # <--- Line XX - ERROR here
my $data = '';
my $seen_eos = 0;
do {
$r->input_filters->get_brigade( $bb, Apache2::Const::MODE_READBYTES,
APR::Const::BLOCK_READ, IOBUFSIZE );
for ( my $b = $bb->first ; $b ; $b = $bb->next($b) ) {
if ( $b->is_eos ) {
$seen_eos++;
last;
}
if ( $b->read( my $buf ) ) {
$data .= $buf;
}
$b->remove; # optimization to reuse memory
}
} while ( !$seen_eos );
$bb->destroy;
return $data;
}
1;
####
...[perl:error] [pid 19117] [client 1.2.3.4:56504] Can't locate object method "pool" via package "Apache2::Filter" at /opt/code/ZCRM/OFilter.pm line xx.\n, referer...