X-Git-Url: http://git.shiar.net/perl/plp/.git/blobdiff_plain/30c44f02696079e94a9dd261e1dcfe0898a5367b..4565100c67dd7b0344e9eb332296d5fa64e7611b:/PLP/Apache.pm diff --git a/PLP/Apache.pm b/PLP/Apache.pm index fd2607b..bc78881 100644 --- a/PLP/Apache.pm +++ b/PLP/Apache.pm @@ -26,14 +26,15 @@ sub init { our $r = shift; $PLP::print = 'PLP::Apache::print'; + $PLP::read = \&read; $ENV{PLP_FILENAME} = my $filename = $r->filename; unless (-f $filename) { - return MP2 ? Apache2::Const::NOT_FOUND() : Apache::Constants::NOT_FOUND(); + return MP2 ? Apache2::Const::HTTP_NOT_FOUND() : Apache::Constants::NOT_FOUND(); } unless (-r _) { - return MP2 ? Apache2::Const::FORBIDDEN() : Apache::Constants::FORBIDDEN(); + return MP2 ? Apache2::Const::HTTP_FORBIDDEN() : Apache::Constants::FORBIDDEN(); } $ENV{PLP_NAME} = $r->uri; @@ -49,6 +50,12 @@ sub init { return 0; # OK } +sub read ($) { + my ($bytes) = @_; + $r->read(my $data, $bytes); + return $data; +} + # FAST printing under mod_perl sub print { return unless grep length, @_;