stas 2004/09/22 17:34:57
Modified: perl-framework/Apache-Test Changes perl-framework/Apache-Test/lib/Apache TestConfig.pm Log: make sure that if -maxclients option is passed on the command line, minclients will never be bigger than that value Revision Changes Path 1.170 +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.169 retrieving revision 1.170 diff -u -u -r1.169 -r1.170 --- Changes 22 Sep 2004 23:14:29 -0000 1.169 +++ Changes 23 Sep 2004 00:34:57 -0000 1.170 @@ -8,6 +8,9 @@ =item 1.14-dev +make sure that if -maxclients option is passed on the command line, +minclients will never be bigger than that value [Stas] + add -one-process runtime argument, which will start the server in single-server mode (httpd -X in Apache 1.X or httpd -D ONE_PROCESS in 2.X) [Geoffrey Young] 1.248 +20 -7 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.247 retrieving revision 1.248 diff -u -u -r1.247 -r1.248 --- TestConfig.pm 21 Sep 2004 23:47:13 -0000 1.247 +++ TestConfig.pm 23 Sep 2004 00:34:57 -0000 1.248 @@ -299,15 +299,24 @@ $vars->{serveradmin} ||= $self->default_serveradmin; $vars->{minclients} ||= 1; - my $maxclientspreset = $vars->{maxclients} || 0; + $vars->{maxclients_preset} = $vars->{maxclients} || 0; + # if maxclients wasn't explicitly passed try to # prevent 'server reached MaxClients setting' errors $vars->{maxclients} ||= $vars->{minclients} + 1; + + # if a preset maxclients valus is smaller than minclients, + # maxclients overrides minclients + if ($vars->{maxclients_preset} && + $vars->{maxclients_preset} < $vars->{minclients}) { + $vars->{minclients} = $vars->{maxclients_preset}; + } + # for threaded mpms MaxClients must be a multiple of # ThreadsPerChild (i.e. maxclients % minclients == 0) # so unless -maxclients was explicitly specified use a double of # minclients - $vars->{maxclientsthreadedmpm} = - $maxclientspreset || $vars->{minclients} * 2; + $vars->{maxclientsthreadedmpm} = + $vars->{maxclients_preset} || $vars->{minclients} * 2; $vars->{proxy} ||= 'off'; $vars->{proxyssl_url} ||= ''; @@ -481,8 +490,10 @@ #if we proxy to ourselves, must bump the maxclients if ($vars->{proxy} =~ /^on$/i) { - $vars->{minclients}++; - $vars->{maxclients}++; + unless ($vars->{maxclients_preset}) { + $vars->{minclients}++; + $vars->{maxclients}++; + } $vars->{proxy} = $self->{vhosts}->{'mod_proxy'}->{hostport}; return $vars->{proxy}; } @@ -1277,8 +1288,10 @@ } if ($vars->{proxyssl_url}) { - $vars->{minclients}++; - $vars->{maxclients}++; + unless ($vars->{maxclients_preset}) { + $vars->{minclients}++; + $vars->{maxclients}++; + } } } }