gozer       2004/02/21 12:28:47

  Modified:    perl-framework/Apache-Test Changes
               perl-framework/Apache-Test/lib/Apache TestConfig.pm
                        TestConfigPerl.pm
               t/response/TestApache conftree.pm
  Log:
  Instead of hard-coding listen directive to 127.0.0.1, use the server
  name.
  
  Reviewed by: stas
  
  Revision  Changes    Path
  1.94      +4 -1      httpd-test/perl-framework/Apache-Test/Changes
  
  Index: Changes
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/Changes,v
  retrieving revision 1.93
  retrieving revision 1.94
  diff -u -r1.93 -r1.94
  --- Changes   20 Feb 2004 23:51:54 -0000      1.93
  +++ Changes   21 Feb 2004 20:28:47 -0000      1.94
  @@ -8,6 +8,9 @@
   
   =item 1.08_dev
   
  +Instead of hard-coding listen directive to 127.0.0.1, use the server
  +name. [Gozer]
  +
   added -defines configuration option, providing a way to pass additional
   -D names to the server for use in <IfDefine> blocks.  [Geoffrey Young]
   
  @@ -27,7 +30,7 @@
   is true.  [Geoffrey Young]
   
   Hard-code listen directive to 127.0.0.1, solving problems for people
  -with IPv4 & IPv6 address until a better solution is found [Gozer]
  +with IPv4 & IPv6 address until a better solution is found. [Gozer]
   
   prefix Apache::TestTrace (non-colour mode) messages with the loglevel,
   similar to what Apache does. [Stas]
  
  
  
  1.210     +3 -14     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.209
  retrieving revision 1.210
  diff -u -r1.209 -r1.210
  --- TestConfig.pm     20 Feb 2004 23:51:54 -0000      1.209
  +++ TestConfig.pm     21 Feb 2004 20:28:47 -0000      1.210
  @@ -634,19 +634,8 @@
       my $module = shift || '';
   
       my $name = $vars->{servername};
  -    my $resolve = \$self->{resolved}->{$name};
   
  -    unless ($$resolve) {
  -        if (gethostbyname $name) {
  -            $$resolve = $name;
  -        }
  -        else {
  -            $$resolve = $self->default_loopback;
  -            warn "lookup $name failed, using $$resolve for client tests\n";
  -        }
  -    }
  -
  -    join ':', $$resolve || 'localhost', $self->port($module || '');
  +    join ':', $name , $self->port($module || '');
   }
   
   #look for mod_foo.so
  @@ -1004,7 +993,7 @@
       my @out_config = ();
       if ($self->{vhosts}->{$module}->{namebased} < 2) {
           #extra config that should go *outside* the <VirtualHost ...>
  -        @out_config = ([Listen => '127.0.0.1:' . $port]);
  +        @out_config = ([Listen => $vars->{servername} . ':' . $port]);
   
           if ($self->{vhosts}->{$module}->{namebased}) {
               push @out_config => [NameVirtualHost => "*:$port"];
  @@ -1772,7 +1761,7 @@
   
   
   __DATA__
  -Listen     127.0.0.1:@Port@
  +Listen     @ServerName@:@Port@
   
   ServerRoot   "@ServerRoot@"
   DocumentRoot "@DocumentRoot@"
  
  
  
  1.83      +2 -1      
httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfigPerl.pm
  
  Index: TestConfigPerl.pm
  ===================================================================
  RCS file: 
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestConfigPerl.pm,v
  retrieving revision 1.82
  retrieving revision 1.83
  diff -u -r1.82 -r1.83
  --- TestConfigPerl.pm 18 Feb 2004 00:30:57 -0000      1.82
  +++ TestConfigPerl.pm 21 Feb 2004 20:28:47 -0000      1.83
  @@ -207,7 +207,8 @@
   sub set_connection_handler {
       my($self, $module, $args) = @_;
       my $port = $self->new_vhost($module);
  -    $self->postamble(Listen => '127.0.0.1:' . $port);
  +    my $vars = $self->{vars};
  +    $self->postamble(Listen => $vars->{servername} . ':' . $port);
   }
   
   my %add_hook_config = (
  
  
  
  1.9       +1 -1      modperl-2.0/t/response/TestApache/conftree.pm
  
  Index: conftree.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestApache/conftree.pm,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- conftree.pm       18 Feb 2004 00:30:57 -0000      1.8
  +++ conftree.pm       21 Feb 2004 20:28:47 -0000      1.9
  @@ -29,7 +29,7 @@
   
       my $listen = $tree->lookup('Listen');
   
  -    ok t_cmp('127.0.0.1:' . $vars->{port}, $listen);
  +    ok t_cmp(join(':', $vars->{servername}, $vars->{port}), $listen);
   
       my $documentroot = $tree->lookup('DocumentRoot');
   
  
  
  

Reply via email to