git.shiar.nl
/
perl
/
plp
/
.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
make mod_perl request object a global in PLP::Apache only
[perl/plp/.git]
/
PLP
/
Apache.pm
diff --git
a/PLP/Apache.pm
b/PLP/Apache.pm
index fd2607bf13f0f5bd82901ceb90d2315cb6d52601..6b28f949f1f0b6fd1b9ff7e6c6bc0313d148d4eb 100644
(file)
--- a/
PLP/Apache.pm
+++ b/
PLP/Apache.pm
@@
-21,19
+21,22
@@
BEGIN {
}
}
}
}
+our $r;
+
# mod_perl initializer: returns 0 on success, Apache error code on failure
sub init {
# 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::print = 'PLP::Apache::print';
+ $PLP::read = \&read;
$ENV{PLP_FILENAME} = my $filename = $r->filename;
unless (-f $filename) {
$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 _) {
}
unless (-r _) {
- return MP2 ? Apache2::Const::FORBIDDEN() : Apache::Constants::FORBIDDEN();
+ return MP2 ? Apache2::Const::
HTTP_
FORBIDDEN() : Apache::Constants::FORBIDDEN();
}
$ENV{PLP_NAME} = $r->uri;
}
$ENV{PLP_NAME} = $r->uri;
@@
-49,11
+52,17
@@
sub init {
return 0; # OK
}
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;
# 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.
}
# This is the mod_perl handler.