stas        2003/11/23 23:59:54

  Modified:    perl-framework/Apache-Test/lib/Apache TestServer.pm
               perl-framework/Apache-Test Changes
  Log:
  Fix a bug in '-port select' which was incorrectly using the same port
  twice
  
  Revision  Changes    Path
  1.72      +6 -5      
httpd-test/perl-framework/Apache-Test/lib/Apache/TestServer.pm
  
  Index: TestServer.pm
  ===================================================================
  RCS file: 
/home/cvs/httpd-test/perl-framework/Apache-Test/lib/Apache/TestServer.pm,v
  retrieving revision 1.71
  retrieving revision 1.72
  diff -u -u -r1.71 -r1.72
  --- TestServer.pm     24 Nov 2003 07:57:30 -0000      1.71
  +++ TestServer.pm     24 Nov 2003 07:59:54 -0000      1.72
  @@ -36,7 +36,7 @@
       $self->{name} = join ':',
         map { $self->{config}->{vars}->{$_} } qw(servername port);
   
  -    $self->{port_counter} = $self->{config}->{vars}->{port};
  +    $self->{port_counter} = $self->{config}->{vars}->{port} + 1;
   
       $self->{version} = $self->{config}->httpd_version || '';
       $self->{mpm}     = $self->{config}->httpd_mpm     || '';
  @@ -269,12 +269,13 @@
       my $self = shift;
   
       my $max_tries = 100; #XXX
  -
  -    while (! $self->port_available(++$self->{port_counter})) {
  -        return 0 if --$max_tries <= 0;
  +    while ($max_tries-- > 0) {
  +        my $port = $self->{port_counter};
  +        $self->{port_counter}++;
  +        return $port if $self->port_available($port);
       }
   
  -    return $self->{port_counter};
  +    return 0;
   }
   
   sub port_available {
  
  
  
  1.66      +3 -0      httpd-test/perl-framework/Apache-Test/Changes
  
  Index: Changes
  ===================================================================
  RCS file: /home/cvs/httpd-test/perl-framework/Apache-Test/Changes,v
  retrieving revision 1.65
  retrieving revision 1.66
  diff -u -u -r1.65 -r1.66
  --- Changes   16 Nov 2003 19:16:19 -0000      1.65
  +++ Changes   24 Nov 2003 07:59:54 -0000      1.66
  @@ -8,6 +8,9 @@
   
   =item 1.07-dev
   
  +Fix a bug in '-port select' which was incorrectly using the same port
  +twice [Stas]
  +
   added bugreport and file argument options to 
   Apache::TestRun::generate_script() [Geoffrey Young]
   
  
  
  

Reply via email to