dougm 01/10/19 18:50:45
Modified: perl-framework/Apache-Test/lib/Apache TestConfig.pm
Log:
add remote_addr variable that should be the same as the Apache REMOTE_ADDR
environment variable
Revision Changes Path
1.78 +9 -0
httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.pm
Index: TestConfig.pm
===================================================================
RCS file:
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfig.pm,v
retrieving revision 1.77
retrieving revision 1.78
diff -u -r1.77 -r1.78
--- TestConfig.pm 2001/10/18 02:44:36 1.77
+++ TestConfig.pm 2001/10/20 01:50:45 1.78
@@ -204,6 +204,7 @@
$vars->{scheme} ||= 'http';
$vars->{servername} ||= $self->default_servername;
$vars->{port} ||= $self->default_port;
+ $vars->{remote_addr} ||= $self->our_remote_addr;
$vars->{user} ||= $self->default_user;
$vars->{group} ||= $self->default_group;
@@ -476,6 +477,14 @@
#XXX: could check if the port is in use and select another if so
sub default_port {
$ENV{APACHE_PORT} || 8529;
+}
+
+my $remote_addr;
+
+sub our_remote_addr {
+ my $self = shift;
+ my $name = $self->default_servername;
+ $remote_addr ||= Socket::inet_ntoa((gethostbyname($name))[-1]);
}
sub default_loopback {