stas 2003/02/06 16:12:25
Modified: ModPerl-Registry/lib/ModPerl RegistryCooker.pm
Log:
always return the run's return status if it's not Apache::OK
Revision Changes Path
1.31 +5 -7 modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm
Index: RegistryCooker.pm
===================================================================
RCS file: /home/cvs/modperl-2.0/ModPerl-Registry/lib/ModPerl/RegistryCooker.pm,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- RegistryCooker.pm 5 Feb 2003 04:06:27 -0000 1.30
+++ RegistryCooker.pm 7 Feb 2003 00:12:25 -0000 1.31
@@ -159,15 +159,13 @@
return $rc unless $rc == Apache::OK;
}
- # handlers shouldn't set $r->status but return it
+ # handlers shouldn't set $r->status but return it, so we reset the
+ # status after running it
my $old_status = $self->[REQ]->status;
my $rc = $self->run;
- my $new_status = $self->[REQ]->status;
-
- # only if the script has changed the status, reset to the old
- # status and return the new status
- return $old_status != $new_status
- ? $self->[REQ]->status($old_status)
+ my $new_status = $self->[REQ]->status($old_status);
+ return ($rc == Apache::OK && $old_status != $new_status)
+ ? $new_status
: $rc;
}