X-Git-Url: http://git.shiar.net/perl/plp/.git/blobdiff_plain/58286f44f06df2a424e09f50312616b96832b30d..52b63e9e0c0e3d3019a2751158f59cae036b6fe4:/PLP/Apache.pm diff --git a/PLP/Apache.pm b/PLP/Apache.pm index c388095..6b28f94 100644 --- a/PLP/Apache.pm +++ b/PLP/Apache.pm @@ -21,11 +21,14 @@ BEGIN { } } +our $r; + # mod_perl initializer: returns 0 on success, Apache error code on failure sub init { - our $r = shift; + $r = shift; $PLP::print = 'PLP::Apache::print'; + $PLP::read = \&read; $ENV{PLP_FILENAME} = my $filename = $r->filename; @@ -49,11 +52,17 @@ 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, @_; PLP::sendheaders() unless $PLP::sentheaders; - $PLP::Apache::r->print(@_); + $r->print(@_); } # This is the mod_perl handler.