I just have one filter in my location tag of httpd.conf:
<Location /testproj/A>
SetHandler modperl
PerlInputFilterHandler MyApache2::Test
</Location>
Test is an PerlInputFilterHandler.
If I've following code in this filter:
package MyApache2::Test10;
use strict;
use Apache2::Const qw(OK);
use Apache2::Filter ();
use Apache2::RequestRec ();
use Apache2::RequestIO ();
sub handler {
my $f = shift;
#my $buf = '';
#while($f->read(my $tempbuf, 1024)) {
# $buf = $tempbuf;
#}
my $r = $f->r;
$r->content_type("text/html\n\n");
$r->print("welcome!!!");
return OK;
}
1;
It generates response - in other words, it sends "welcome!!!" to browser.
However if I've following code (enables commented code):
package MyApache2::Test10;
use strict;
use Apache2::Const qw(OK);
use Apache2::Filter ();
use Apache2::RequestRec ();
use Apache2::RequestIO ();
sub handler {
my $f = shift;
my $buf = '';
while($f->read(my $tempbuf, 1024)) {
$buf = $tempbuf;
}
my $r = $f->r;
$r->content_type("text/html\n\n");
$r->print("welcome!!!");
return OK;
}
1;
This doesn't work. The "welcome!!!" doesn't go to the browser - '404' does.
Can you suggest something here?
Thanks very much!