sub class { return scalar(caller); }
+=head2 OSRF_APACHE_REQUEST_OBJ
+
+Gets and sets the Apache request object when running inside mod_perl.
+This allows other parts of OpenSRF to investigate the state of the
+remote connection, such as whether the client has disconnected, and
+react accordingly.
+
+=cut
+
+our $_OARO;
+sub OSRF_APACHE_REQUEST_OBJ {
+ my $self = shift;
+ my $a = shift;
+ $_OARO = $a if $a;
+ return $_OARO;
+}
+
1;
vec($infile, $socket->fileno, 1) = 1;
my $nfound;
- if (!$ENV{OSRF_APACHE_REQUEST_OBJ} || $timeout <= 1.0) {
+ if (!OpenSRF->OSRF_APACHE_REQUEST_OBJ || $timeout <= 1.0) {
$nfound = select($infile, undef, undef, $timeout);
} else {
$timeout -= 1.0;
$nfound = select($infile, undef, undef, $sleep);
last if $nfound;
if (
- $ENV{OSRF_APACHE_REQUEST_OBJ} &&
- $ENV{OSRF_APACHE_REQUEST_OBJ}->connection->aborted
+ OpenSRF->OSRF_APACHE_REQUEST_OBJ &&
+ OpenSRF->OSRF_APACHE_REQUEST_OBJ->connection->aborted
) {
# Should this be more severe? Die or throw error?
$logger->warn("Upstream Apache client disconnected, aborting.");