With the reading of Apache_Clean module (which i see is streamed-oriented) and 
with ideas
of Ambrosino, i am with this:


sub handler : FilterRequestHandler {
my($f, $bb) = @_;
my $rv;


unless ($f->ctx) {
$f->r->headers_out->unset('Content-Length');
$f->ctx({html => ''});
}


while (!$bb->is_empty) {
my $b = $bb->first;
$b->remove;

if ($b->read(my $data)) {
$f->ctx->{html} .= $data;
}

if ($b->is_eos) {
$this->MYFUNCTION(\$f->ctx->{html},$f->r,$f->c);

#new bucket brigade to be filled with modified buckets
my $nbb = APR::Brigade->new($f->c->pool,$f->c->bucket_alloc);

#new bucket, a unique and big bucket, is it efficient?
$b = APR::Bucket->new($bb->bucket_alloc,$f->ctx->{html});

$nbb->insert_tail($b);
$rv = $f->next->pass_brigade($nbb);
last;
}


}


return $rv unless $rv == APR::Const::SUCCESS;
Apache2::Const::OK;
}


Despite considerations about the efficacy of this procedure (i really suspect 
that a
streaming-oriented approach could be indeed more efficient, but i am an 
ignorant), i
cannot get a valid response.

I get the typical 500 internal server error with no entries in logs, so i guess 
is
something about the return value.




Note: I'm having problems with
my $mm = Apache2::Request->new($apache);
my $mm = Apache2::Request->new($apache,POST_MAX => '50000');

Second line is causing the error: "Conflicting information". Very strange. 15 
minutes
before i had the same problem with
my $mm = Apache2::Request->new($apache,POST_MAX => 50000);
but i solved (during 10 minutes) with the commas
my $mm = Apache2::Request->new($apache,POST_MAX => '50000');
but now it appears again.

Without it i am sure that the above filter funcion is running right.

---------------------------------------------------------
Juega y llévate una PS2 two: 
http://juegos.ya.com/consolas_y_pc/2005/09/concurso-ps2.html
Ya.com ADSL 2MB + Llamadas 24 horas: desde 26,95 €/mes + IVA. Navega y habla de 
forma ilimitada. Sin compromiso de permanencia. 
http://acceso.ya.com/ADSLllamadas/2mb

Reply via email to