perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jkal...@apache.org
Subject svn commit: r1617891 - /perl/modperl/trunk/lib/Apache2/compat.pm
Date Thu, 14 Aug 2014 06:56:34 GMT
Author: jkaluza
Date: Thu Aug 14 06:56:34 2014
New Revision: 1617891

URL: http://svn.apache.org/r1617891
Log:
This fixes t/compat/conn_rec.t. failures with Apache 2.4,
broken with r1497279.

Apache2::compat is supposed to provide mod_perl 1.0 backward
compatibility, so we want to offer remote_addr() there even with
Apache 2.4.

Submitted by: Niko Tyni <ntyni debian.org>

Modified:
    perl/modperl/trunk/lib/Apache2/compat.pm

Modified: perl/modperl/trunk/lib/Apache2/compat.pm
URL: http://svn.apache.org/viewvc/perl/modperl/trunk/lib/Apache2/compat.pm?rev=1617891&r1=1617890&r2=1617891&view=diff
==============================================================================
--- perl/modperl/trunk/lib/Apache2/compat.pm (original)
+++ perl/modperl/trunk/lib/Apache2/compat.pm Thu Aug 14 06:56:34 2014
@@ -150,7 +150,12 @@ EOI
     require Apache2::Connection;
     require APR::SockAddr;
     require Socket;
-    my $orig_sub = *Apache2::Connection::remote_addr{CODE};
+    my $orig_sub;
+    if (defined *Apache2::Connection::client_addr{CODE}) { # httpd-2.4
+        $orig_sub = *Apache2::Connection::client_addr{CODE};
+    } else { # httpd-2.2
+        $orig_sub = *Apache2::Connection::remote_addr{CODE};
+    }
     *Apache2::Connection::remote_addr = sub {
         my $c = shift;
         if (@_) {



Mime
View raw message