perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jkal...@apache.org
Subject svn commit: r1448199 - /perl/modperl/branches/httpd24/t/response/TestAPR/sockaddr.pm
Date Wed, 20 Feb 2013 14:49:22 GMT
Author: jkaluza
Date: Wed Feb 20 14:49:22 2013
New Revision: 1448199

URL: http://svn.apache.org/r1448199
Log:
* t/response/TestAPR/sockaddr.pm: Use client_ip/client_addr instead of
  remote_ip/remote_addr

Modified:
    perl/modperl/branches/httpd24/t/response/TestAPR/sockaddr.pm

Modified: perl/modperl/branches/httpd24/t/response/TestAPR/sockaddr.pm
URL: http://svn.apache.org/viewvc/perl/modperl/branches/httpd24/t/response/TestAPR/sockaddr.pm?rev=1448199&r1=1448198&r2=1448199&view=diff
==============================================================================
--- perl/modperl/branches/httpd24/t/response/TestAPR/sockaddr.pm (original)
+++ perl/modperl/branches/httpd24/t/response/TestAPR/sockaddr.pm Wed Feb 20 14:49:22 2013
@@ -13,6 +13,7 @@ use Apache2::RequestRec ();
 use APR::SockAddr ();
 
 use Apache2::Const -compile => 'OK';
+use constant APACHE24   => have_min_apache_version('2.4.0');
 
 sub handler {
     my $r = shift;
@@ -21,10 +22,15 @@ sub handler {
     plan $r, tests => 4;
 
     my $local  = $c->local_addr;
-    my $remote = $c->remote_addr;
+    my $remote = APACHE24 ? $c->client_addr : $c->remote_addr;
 
     ok t_cmp($local->ip_get,  $c->local_ip,  "local ip");
-    ok t_cmp($remote->ip_get, $c->remote_ip, "remote ip");
+    if (APACHE24) {
+        ok t_cmp($remote->ip_get, $c->client_ip, "client ip");
+    }
+    else {
+        ok t_cmp($remote->ip_get, $c->remote_ip, "remote ip");
+    }
 
     $r->subprocess_env;
     ok t_cmp($local->port,  $ENV{SERVER_PORT}, "local port");



Mime
View raw message