On Mon 03 Dec 2007, Torsten Foertsch wrote: > 30.diff > expands tabs in *.p[lm] > This patch is too big for the 100000 byte limit of the mailing list and > will be sent in 2 parts.
Part 1
Index: Apache-Test/Apache-TestItSelf/lib/MyTest/Util.pm =================================================================== --- Apache-Test/Apache-TestItSelf/lib/MyTest/Util.pm (revision 29) +++ Apache-Test/Apache-TestItSelf/lib/MyTest/Util.pm (revision 30) @@ -136,9 +136,9 @@ timeout => 200, makepl_arg => 'MOD_PERL=2 -libmodperl mod_perl-5.8.5-ithread.so', ); - + my $path = "/home/$ENV{USER}/httpd"; - + @Apache::TestItSelf::Configs = ( { apxs_exec => "$path/prefork/bin/apxs", Index: Apache-Test/lib/Apache/TestRun.pm =================================================================== --- Apache-Test/lib/Apache/TestRun.pm (revision 29) +++ Apache-Test/lib/Apache/TestRun.pm (revision 30) @@ -49,7 +49,7 @@ my %original_t_perms = (); my @std_run = qw(start-httpd run-tests stop-httpd); -my @others = qw(verbose configure clean help ssl http11 bugreport +my @others = qw(verbose configure clean help ssl http11 bugreport save no-httpd one-process); my @flag_opts = (@std_run, @others); my @string_opts = qw(order trace); @@ -212,7 +212,7 @@ # a workaround to support -verbose and -verbose=0|1 # $Getopt::Long::VERSION > 2.26 can use the "verbose:1" rule # but we have to support older versions as well - @ARGV = grep defined, + @ARGV = grep defined, map {/-verbose=(\d)/ ? ($1 ? '-verbose' : undef) : $_ } @ARGV; # permute : optional values can come before the options @@ -868,7 +868,7 @@ $core_files{$file} = -M $file; push @cores, $file; } - return @cores + return @cores ? join "\n", "server dumped core, for stacktrace, run:", map { "gdb $vars->{httpd} -core $_" } @cores : (); @@ -980,7 +980,7 @@ my($uid, $gid) = (getpwnam($user))[2..3] or die "Can't find out uid/gid of '$user'"; - warning "root mode: ". + warning "root mode: ". "changing the files ownership to '$user' ($uid:$gid)"; finddepth(sub { $original_t_perms{$File::Find::name} = [(stat $_)[4..5]]; @@ -1372,13 +1372,13 @@ directly. Here is an example of a custom C<t/TEST> My::TestRun->new->run(@ARGV); - + package My::TestRun; use base 'Apache::TestRun'; sub bug_report { my $self = shift; - + print <<EOI; +--------------------------------------------------------+ | Please file a bug report: http://perl.apache.org/bugs/ | @@ -1402,12 +1402,12 @@ use base 'Apache::TestRun'; use Apache::TestConfig; __PACKAGE__->new->run(@ARGV); - + sub pre_configure { my $self = shift; # Don't load an installed mod_apreq Apache::TestConfig::autoconfig_skip_module_add('mod_apreq.c'); - + $self->SUPER::pre_configure(); } Index: Apache-Test/lib/Apache/TestSSLCA.pm =================================================================== --- Apache-Test/lib/Apache/TestSSLCA.pm (revision 29) +++ Apache-Test/lib/Apache/TestSSLCA.pm (revision 30) @@ -54,7 +54,7 @@ # in 0.9.7 s/Email/emailAddress/ in DN my $email_field = Apache::Test::normalize_vstring($version) < - Apache::Test::normalize_vstring("0.9.7") ? + Apache::Test::normalize_vstring("0.9.7") ? "Email" : "emailAddress"; my $ca_dn = { @@ -214,7 +214,7 @@ challengePassword = $pass [ ca ] -default_ca = CA_default +default_ca = CA_default [ CA_default ] certs = certs # Where the issued certs are kept @@ -233,13 +233,13 @@ preserve = no # keep passed DN ordering [ policy_anything ] -countryName = optional -stateOrProvinceName = optional -localityName = optional -organizationName = optional -organizationalUnitName = optional -commonName = supplied -emailAddress = optional +countryName = optional +stateOrProvinceName = optional +localityName = optional +organizationName = optional +organizationalUnitName = optional +commonName = supplied +emailAddress = optional [ comment ] nsComment = This Is A Comment Index: Apache-Test/lib/Apache/TestConfigC.pm =================================================================== --- Apache-Test/lib/Apache/TestConfigC.pm (revision 29) +++ Apache-Test/lib/Apache/TestConfigC.pm (revision 30) @@ -385,9 +385,9 @@ module MODULE_VAR_EXPORT name ## _module = { STANDARD_MODULE_STUFF, - NULL, /* initializer */ + NULL, /* initializer */ $cmodule_config_hooks, - name ## _handlers, /* handlers */ + name ## _handlers, /* handlers */ $cmodule_hooks_1 } EOF Index: Apache-Test/lib/Apache/TestHarnessPHP.pm =================================================================== --- Apache-Test/lib/Apache/TestHarnessPHP.pm (revision 29) +++ Apache-Test/lib/Apache/TestHarnessPHP.pm (revision 30) @@ -59,16 +59,16 @@ my $ts = $args->{tests} || []; if (@$ts) { - for (@$ts) { - if (-d $_) { - push(@tests, sort <$base/$_/*.t>); - push(@tests, sort <$base/$_/*.php>); - } - else { - $_ .= ".t" unless /(\.t|\.php)$/; - push(@tests, $_); - } - } + for (@$ts) { + if (-d $_) { + push(@tests, sort <$base/$_/*.t>); + push(@tests, sort <$base/$_/*.php>); + } + else { + $_ .= ".t" unless /(\.t|\.php)$/; + push(@tests, $_); + } + } } else { if ($args->{tdirs}) { Index: Apache-Test/lib/Apache/TestRunPHP.pm =================================================================== --- Apache-Test/lib/Apache/TestRunPHP.pm (revision 29) +++ Apache-Test/lib/Apache/TestRunPHP.pm (revision 30) @@ -199,7 +199,7 @@ and C</my/local/apache/bin/httpd> will be propagated throughout the rest of the process. note that PHP needs to be active within Apache -prior to configuring the test framework as shown above, either by +prior to configuring the test framework as shown above, either by virtue of PHP being compiled into the C<httpd> binary statically or through an active C<LoadModule> statement within the configuration located in C</my/local/apache/conf/httpd.conf>. Other required modules @@ -268,7 +268,7 @@ the include library C<test-more.php> is automatically generated by C<Apache::TestConfigPHP> and configurations tweaked in such a -a way that your PHP scripts can find it without issue. the +a way that your PHP scripts can find it without issue. the functions provided by C<test-more.php> are equivalent in name and function to those in C<Test::More>, a standard Perl testing library, so you can see that manpage for details on the syntax @@ -276,10 +276,10 @@ at this point, we have enough in place to run some tests from PHP-land - a C<Makefile.PL> to configure Apache for us, and -a PHP script in C<t/response/TestFoo/bar.php> to send some +a PHP script in C<t/response/TestFoo/bar.php> to send some results out to the testing engine. issuing C<make test> would start Apache, issue the request to C<bar.php>, generate -a report, and shut down Apache. the report would look like +a report, and shut down Apache. the report would look like something like this after running the tests in verbose mode (eg C<make test TEST_VERBOSE=1>): Index: Apache-Test/lib/Apache/TestConfigPHP.pm =================================================================== --- Apache-Test/lib/Apache/TestConfigPHP.pm (revision 29) +++ Apache-Test/lib/Apache/TestConfigPHP.pm (revision 30) @@ -509,7 +509,7 @@ global $_num_failures; global $_num_skips; - $_test_num++; + $_test_num++; if ($_num_skips) { @@ -715,7 +715,7 @@ { $pass = ((require $module) == 'OK'); return ok($pass); -} +} function skip($message, $num) { Index: Apache-Test/lib/Apache/TestClient.pm =================================================================== --- Apache-Test/lib/Apache/TestClient.pm (revision 29) +++ Apache-Test/lib/Apache/TestClient.pm (revision 30) @@ -136,7 +136,7 @@ close $s; # an empty body is a valid response - $res->{content} = '' + $res->{content} = '' unless exists $res->{content} and defined $res->{content}; $res->{headers_as_string} =~ s/\015//g; #for as_string Index: Apache-Test/lib/Apache/Test.pm =================================================================== --- Apache-Test/lib/Apache/Test.pm (revision 29) +++ Apache-Test/lib/Apache/Test.pm (revision 30) @@ -28,7 +28,7 @@ # check first (and we choose mp2) $mod_perl::VERSION == 2.0 # just because someone loaded Apache::Test. This Is Bad. so, # let's try to correct for that here by removing mod_perl from - # %INC after the above use() statements settle in. nobody + # %INC after the above use() statements settle in. nobody # should be relying on us loading up mod_perl.pm anyway... delete $INC{'mod_perl.pm'}; @@ -73,9 +73,9 @@ if (($_[0] and $_[0] =~ m/^-withtestmore/) || @testmore) { # special hoops for Test::More support - $real_plan = eval { + $real_plan = eval { - require Test::More; + require Test::More; no warnings qw(numeric); Test::Builder->VERSION('0.18_01'); @@ -152,7 +152,7 @@ $builder->output(\*STDOUT); $builder->todo_output(\*STDOUT); - # this is STDOUT because Test::More seems to put + # this is STDOUT because Test::More seems to put # most of the stuff we want on STDERR, so it ends # up in the error_log instead of where the user can # see it. consider leaving it alone based on @@ -636,7 +636,7 @@ use need(): plan tests => 5, - need 'LWP', + need 'LWP', { "not Win32" => sub { $^O eq 'MSWin32'} }; see C<need()> for more info. @@ -704,7 +704,7 @@ within test logic to adjust expectations based on older or newer server versions. -=over +=over =item need_http11 @@ -862,7 +862,7 @@ plan tests => 5, need 'LWP', - { "perl >= 5.8.0 and w/ithreads is required" => + { "perl >= 5.8.0 and w/ithreads is required" => ($Config{useperlio} && $] >= 5.008) }, { "not Win32" => sub { $^O eq 'MSWin32' }, "foo is disabled" => \&is_foo_enabled, @@ -970,11 +970,11 @@ =head1 Test::More Integration -There are a few caveats if you want to use I<Apache::Test> with +There are a few caveats if you want to use I<Apache::Test> with I<Test::More> instead of the default I<Test> backend. The first is that I<Test::More> requires you to use its own C<plan()> function and not the one that ships with I<Apache::Test>. I<Test::More> also -defines C<ok()> and C<skip()> functions that are different, and +defines C<ok()> and C<skip()> functions that are different, and simply C<use>ing both modules in your test script will lead to redefined warnings for these subroutines. @@ -990,7 +990,7 @@ ok ('yes', 'testing ok'); # Test::More::ok() -Now, while this works fine for standard client-side tests +Now, while this works fine for standard client-side tests (such as C<t/basic.t>), the more advanced features of I<Apache::Test> require using I<Test::More> as the sole driver behind the scenes. @@ -1014,7 +1014,7 @@ instead of I<Test.pm> behind the scenes. Note that you are not required to C<use Test::More> yourself with the C<-withtestmore> option and that the C<use Test::More tests =E<gt> 1> syntax -may have unexpected results. +may have unexpected results. Note that I<Test::More> version 0.49, available within the I<Test::Simple> 0.49 distribution on CPAN, or greater is required Index: Apache-Test/lib/Apache/TestConfigPerl.pm =================================================================== --- Apache-Test/lib/Apache/TestConfigPerl.pm (revision 29) +++ Apache-Test/lib/Apache/TestConfigPerl.pm (revision 30) @@ -81,7 +81,7 @@ my $lib = "$Config{installbin}\\$Config{libperl}"; $lib =~ s/lib$/dll/; $cfg = 'LoadFile ' . qq("$lib"\n) if -e $lib; - } + } # add the module we found to the cached modules list # otherwise have_module('mod_perl') doesn't work unless # we have a LoadModule in our base config @@ -148,7 +148,7 @@ # propogate PerlPassEnv settings to the server sub configure_env { my $self = shift; - $self->preamble(IfModule => 'mod_perl.c', + $self->preamble(IfModule => 'mod_perl.c', [ qw(PerlPassEnv APACHE_TEST_TRACE_LEVEL PerlPassEnv HARNESS_PERL_SWITCHES) ]); Index: Apache-Test/lib/Apache/TestMB.pm =================================================================== --- Apache-Test/lib/Apache/TestMB.pm (revision 29) +++ Apache-Test/lib/Apache/TestMB.pm (revision 30) @@ -4,7 +4,7 @@ # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software Index: Apache-Test/lib/Apache/TestHarness.pm =================================================================== --- Apache-Test/lib/Apache/TestHarness.pm (revision 29) +++ Apache-Test/lib/Apache/TestHarness.pm (revision 30) @@ -86,7 +86,7 @@ } } } - + my $cmd = qq[$^X $source_lib $file]; my $h = Symbol::gensym(); @@ -140,15 +140,15 @@ my $ts = $args->{tests} || []; if (@$ts) { - for (@$ts) { - if (-d $_) { - push(@tests, sort <$base/$_/*.t>); - } - else { - $_ .= ".t" unless /\.t$/; - push(@tests, $_); - } - } + for (@$ts) { + if (-d $_) { + push(@tests, sort <$base/$_/*.t>); + } + else { + $_ .= ".t" unless /\.t$/; + push(@tests, $_); + } + } } else { if ($args->{tdirs}) { Index: Apache-Test/lib/Apache/TestConfig.pm =================================================================== --- Apache-Test/lib/Apache/TestConfig.pm (revision 29) +++ Apache-Test/lib/Apache/TestConfig.pm (revision 30) @@ -761,7 +761,7 @@ sub select_first_port { my $self = shift; - my $port ||= $port_memoized || $ENV{APACHE_TEST_PORT} + my $port ||= $port_memoized || $ENV{APACHE_TEST_PORT} || $self->{vars}{port} || DEFAULT_PORT; # memoize @@ -1400,7 +1400,7 @@ finddepth(sub { return unless /\.in$/; (my $generated = $File::Find::name) =~ s/\.in$//; - push @need_update, $generated + push @need_update, $generated unless -e $generated && -M $generated < -M $File::Find::name; }, $self->{vars}->{t_conf}); @@ -1645,7 +1645,7 @@ # if httpd.conf is older than executable push @reasons, "$exe is newer than $vars->{t_conf_file}" - if -e $exe && + if -e $exe && -e $vars->{t_conf_file} && -M $exe < -M $vars->{t_conf_file}; @@ -1899,7 +1899,7 @@ $cfg .= qx{$command}; $cfg .= ldd_as_string($httpd); - } + } else { $cfg .= "\n\n*** The httpd binary was not found\n"; } @@ -1934,7 +1934,7 @@ return $cfg; } - + # make a string suitable for feed to shell calls (wrap in quotes and # escape quotes) sub shell_ready { @@ -2213,7 +2213,7 @@ sub custom_config_add_conf_opts { my $args = shift; - return unless $Apache::TestConfigData::vars and + return unless $Apache::TestConfigData::vars and keys %$Apache::TestConfigData::vars; debug "overlaying custom config data"; @@ -2330,7 +2330,7 @@ } my $optional = 0; my $wanted = 'httpd'; - $vars->{$wanted} = + $vars->{$wanted} = _custom_config_prompt_path($wanted, \%choices, $optional); } @@ -2369,7 +2369,7 @@ } my $optional = 1; my $wanted = 'apxs'; - $vars->{$wanted} = + $vars->{$wanted} = _custom_config_prompt_path($wanted, \%choices, $optional); } Index: Apache-Test/lib/Apache/TestServer.pm =================================================================== --- Apache-Test/lib/Apache/TestServer.pm (revision 29) +++ Apache-Test/lib/Apache/TestServer.pm (revision 30) @@ -306,9 +306,9 @@ # debug httpd startup code. 6.5 has been proven # to work. FreeBSD typically installs this as # gdb65. - # Is it worth it to check the debugger and os version + # Is it worth it to check the debugger and os version # and die ? - + unless (grep { /^$opts->{debugger}/ } keys %debuggers) { error "$opts->{debugger} is not a supported debugger", "These are the supported debuggers: ". @@ -316,7 +316,7 @@ die("\n"); } - my $debugger = $opts->{debugger}; + my $debugger = $opts->{debugger}; $debugger =~ s/\d+$//; my $method = "start_" . $debuggers{$debugger}; Index: Apache-Test/lib/Apache/TestUtil.pm =================================================================== --- Apache-Test/lib/Apache/TestUtil.pm (revision 29) +++ Apache-Test/lib/Apache/TestUtil.pm (revision 30) @@ -43,7 +43,7 @@ ); @EXPORT_OK = qw(t_write_perl_script t_write_shell_script t_chown - t_catfile_apache t_catfile + t_catfile_apache t_catfile t_start_error_log_watch t_finish_error_log_watch); %CLEAN = (); @@ -132,7 +132,7 @@ sub t_cmp ($$;$) { - Carp::carp(join(":", (caller)[1..2]) . + Carp::carp(join(":", (caller)[1..2]) . ' usage: $res = t_cmp($received, $expected, [$comment])') if @_ < 2 || @_ > 3; @@ -364,7 +364,7 @@ } } -my $banner_format = +my $banner_format = "\n*** The following %s expected and harmless ***\n"; sub is_expected_banner { @@ -767,9 +767,9 @@ use Apache::Test; use Apache::TestUtil; use Apache::TestRequest qw(GET); - + plan tests => 1; - + t_client_log_error_is_expected(); my $url = "/error_document/cannot_be_found"; my $res = GET($url); @@ -779,7 +779,7 @@ similar to the following snippet: *** The following error entry is expected and harmless *** - [Tue Apr 01 14:02:55 2003] [error] [client 127.0.0.1] + [Tue Apr 01 14:02:55 2003] [error] [client 127.0.0.1] File does not exist: /tmp/test/t/htdocs/error When more than one entry is expected, an optional numerical argument, Index: Apache-Test/lib/Apache/TestSmoke.pm =================================================================== --- Apache-Test/lib/Apache/TestSmoke.pm (revision 29) +++ Apache-Test/lib/Apache/TestSmoke.pm (revision 30) @@ -282,7 +282,7 @@ # this is a special mode, which really just runs 't/TEST -start; # t/TEST -run; t/TEST -stop;' but it runs '-run' separately for each -# test, and checks whether anything bad has happened after the run +# test, and checks whether anything bad has happened after the run # of each test (i.e. either a test has failed, or a test may be successful, # but server may have dumped a core file, we detect that). sub run_bug_mode { @@ -316,7 +316,7 @@ ($self->{times} > 1 ? "s" : ""); # first time run all tests, or all specified tests - my @tests = @{ $self->{tests} }; # copy + my @tests = @{ $self->{tests} }; # copy my $bad = $self->run_test($iter, $reduce_iter, [EMAIL PROTECTED], [EMAIL PROTECTED]); unless ($bad) { $self->{total_iterations}++; @@ -420,7 +420,7 @@ my $c = 0; return sub { - $c++; # remember stream's state + $c++; # remember stream's state # a single item is not reduce-able return [EMAIL PROTECTED] if $items == 1; @@ -659,7 +659,7 @@ my $unique_seqs = scalar keys %{ $self->{results} }; my $attempts = $self->{total_reduction_attempts}; my $successes = $self->{total_reduction_successes}; - my $completion = $self->{smoking_completed} + my $completion = $self->{smoking_completed} ? "Completed" : "Not Completed (aborted by user)"; @@ -931,16 +931,16 @@ I<t/SMOKE.PL> is driving this module, if you don't have it, create it: #!perl - + use strict; use warnings FATAL => 'all'; - + use FindBin; use lib "$FindBin::Bin/../Apache-Test/lib"; use lib "$FindBin::Bin/../lib"; - + use Apache::TestSmoke (); - + Apache::TestSmoke->new(@ARGV)->run; usually I<Makefile.PL> converts it into I<t/SMOKE> while adjusting the Index: Apache-Test/lib/Apache/TestRequest.pm =================================================================== --- Apache-Test/lib/Apache/TestRequest.pm (revision 29) +++ Apache-Test/lib/Apache/TestRequest.pm (revision 30) @@ -18,7 +18,7 @@ use strict; use warnings FATAL => 'all'; -BEGIN { +BEGIN { $ENV{PERL_LWP_USE_HTTP_10} = 1; # default to http/1.0 $ENV{APACHE_TEST_HTTP_09_OK} ||= 0; # 0.9 responses are ok } @@ -688,7 +688,7 @@ return $res->content if $res->is_success; - die join "\n", + die join "\n", "request has failed (the response code was: " . $res->code . ")", "see t/logs/error_log for more details\n"; } Index: Apache-Test/lib/Apache/TestTrace.pm =================================================================== --- Apache-Test/lib/Apache/TestTrace.pm (revision 29) +++ Apache-Test/lib/Apache/TestTrace.pm (revision 30) @@ -96,7 +96,7 @@ sub c_trace { my ($level, $prefix_type) = (shift, shift); my $prefix = prefix($prefix_type); - print $LogFH + print $LogFH map { "$colors{$level}$prefix$_$colors{reset}\n"} grep defined($_), expand(@_); } @@ -104,8 +104,8 @@ sub nc_trace { my ($level, $prefix_type) = (shift, shift); my $prefix = prefix($prefix_type); - print $LogFH - map { sprintf "[%7s] %s%s\n", $level, $prefix, $_ } + print $LogFH + map { sprintf "[%7s] %s%s\n", $level, $prefix, $_ } grep defined($_), expand(@_); } @@ -126,10 +126,10 @@ } sub trace_level { - # overriden by user/-trace + # overriden by user/-trace (defined $Level && $levels{$Level}) || # or overriden by env var - (exists $ENV{APACHE_TEST_TRACE_LEVEL} && + (exists $ENV{APACHE_TEST_TRACE_LEVEL} && $levels{$ENV{APACHE_TEST_TRACE_LEVEL}}) || # or default $levels{$default_level}; @@ -145,39 +145,39 @@ =head1 SYNOPSIS use Apache::TestTrace; - + debug "foo bar"; - + info_sub "missed it"; - + error_mark "something is wrong"; # test sub that exercises all the tracing functions sub test { - print $Apache::TestTrace::LogFH + print $Apache::TestTrace::LogFH "TraceLevel: $Apache::TestTrace::Level\n"; $_->($_,[1..3],$_) for qw(emerg alert crit error warning notice info debug todo); print $Apache::TestTrace::LogFH "\n\n" }; - + # demo the trace subs using default setting test(); - + { # override the default trace level with 'crit' local $Apache::TestTrace::Level = 'crit'; # now only 'crit' and higher levels will do tracing lower level test(); } - + { # set the trace level to 'debug' local $Apache::TestTrace::Level = 'debug'; # now only 'debug' and higher levels will do tracing lower level test(); } - + { open OUT, ">/tmp/foo" or die $!; # override the default Log filehandle @@ -186,10 +186,10 @@ test(); close OUT; } - + # override tracing level via -trace opt % t/TEST -trace=debug - + # override tracing level via env var % env APACHE_TEST_TRACE_LEVEL=debug t/TEST Index: t/hooks/TestHooks/cleanup2.pm =================================================================== --- t/hooks/TestHooks/cleanup2.pm (revision 29) +++ t/hooks/TestHooks/cleanup2.pm (revision 30) @@ -19,7 +19,7 @@ use Apache2::Const -compile => qw(OK DECLINED); use APR::Const -compile => 'SUCCESS'; -my $file = catfile Apache::Test::config->{vars}->{documentroot}, +my $file = catfile Apache::Test::config->{vars}->{documentroot}, "hooks", "cleanup2"; sub handler { Index: t/hooks/TestHooks/push_handlers_anon.pm =================================================================== --- t/hooks/TestHooks/push_handlers_anon.pm (revision 29) +++ t/hooks/TestHooks/push_handlers_anon.pm (revision 30) @@ -46,9 +46,9 @@ <Perl > my $s = Apache2::PerlSections->server; - $s->push_handlers(PerlFixupHandler => + $s->push_handlers(PerlFixupHandler => sub { &TestHooks::push_handlers_anon::add_note }); - $s->push_handlers(PerlFixupHandler => + $s->push_handlers(PerlFixupHandler => \&TestHooks::push_handlers_anon::add_note ); $s->push_handlers(PerlFixupHandler => "TestHooks::push_handlers_anon::add_note" ); Index: t/hooks/TestHooks/stacked_handlers2.pm =================================================================== --- t/hooks/TestHooks/stacked_handlers2.pm (revision 29) +++ t/hooks/TestHooks/stacked_handlers2.pm (revision 30) @@ -1,6 +1,6 @@ package TestHooks::stacked_handlers2; -# this test exercises the execution of the stacked handlers +# this test exercises the execution of the stacked handlers # connection, translation, authen, authz, type, and response # phases should end for the first handler that returns OK @@ -17,28 +17,28 @@ use Apache2::Const -compile => qw(OK DECLINED AUTH_REQUIRED SERVER_ERROR); -sub ok { +sub ok { callback(shift); return Apache2::Const::OK; } -sub declined { +sub declined { callback(shift); return Apache2::Const::DECLINED; } -sub auth_required { +sub auth_required { callback(shift); return Apache2::Const::AUTH_REQUIRED; } -sub server_error { +sub server_error { callback(shift); @@ -88,9 +88,9 @@ foreach my $callback (qw(PerlPostReadRequestHandler PerlTransHandler PerlMapToStorageHandler - PerlHeaderParserHandler - PerlAccessHandler - PerlAuthenHandler + PerlHeaderParserHandler + PerlAccessHandler + PerlAuthenHandler PerlAuthzHandler PerlTypeHandler PerlFixupHandler @@ -165,14 +165,14 @@ PerlHeaderParserHandler TestHooks::stacked_handlers2::declined TestHooks::stacked_handlers2::ok # all 2 run - PerlAccessHandler TestHooks::stacked_handlers2::ok TestHooks::stacked_handlers2::ok + PerlAccessHandler TestHooks::stacked_handlers2::ok TestHooks::stacked_handlers2::ok # 2 run, 1 left behind - PerlAuthenHandler TestHooks::stacked_handlers2::declined TestHooks::stacked_handlers2::ok + PerlAuthenHandler TestHooks::stacked_handlers2::declined TestHooks::stacked_handlers2::ok PerlAuthenHandler TestHooks::stacked_handlers2::auth_required # 2 run, 1 left behind - PerlAuthzHandler TestHooks::stacked_handlers2::declined TestHooks::stacked_handlers2::ok + PerlAuthzHandler TestHooks::stacked_handlers2::declined TestHooks::stacked_handlers2::ok PerlAuthzHandler TestHooks::stacked_handlers2::auth_required # 1 run, 1 left behind @@ -183,7 +183,7 @@ PerlFixupHandler TestHooks::stacked_handlers2::push_handlers # 2 run, 2 left behind - PerlResponseHandler TestHooks::stacked_handlers2::declined TestHooks::stacked_handlers2 + PerlResponseHandler TestHooks::stacked_handlers2::declined TestHooks::stacked_handlers2 PerlResponseHandler TestHooks::stacked_handlers2::ok TestHooks::stacked_handlers2::server_error SetHandler modperl Index: t/hooks/TestHooks/push_handlers_same_phase.pm =================================================================== --- t/hooks/TestHooks/push_handlers_same_phase.pm (revision 29) +++ t/hooks/TestHooks/push_handlers_same_phase.pm (revision 30) @@ -1,6 +1,6 @@ package TestHooks::push_handlers_same_phase; -# test that we +# test that we # - can push handlers into the same phase that is currently running # - cannot switch 'perl-script' to 'modperl' and vice versa once # inside the response phase Index: t/hooks/TestHooks/authz.pm =================================================================== --- t/hooks/TestHooks/authz.pm (revision 29) +++ t/hooks/TestHooks/authz.pm (revision 30) @@ -16,8 +16,8 @@ unless($r->user and $sent_pw) { # testing $r->note_auth_failure: # AuthType Basic + note_auth_failure == note_basic_auth_failure; - $r->note_auth_failure; - return Apache2::Const::HTTP_UNAUTHORIZED; + $r->note_auth_failure; + return Apache2::Const::HTTP_UNAUTHORIZED; } return Apache2::Const::OK; Index: t/hooks/TestHooks/push_handlers.pm =================================================================== --- t/hooks/TestHooks/push_handlers.pm (revision 29) +++ t/hooks/TestHooks/push_handlers.pm (revision 30) @@ -17,7 +17,7 @@ $r->handler("modperl"); $r->push_handlers(PerlResponseHandler => \&coderef); - $r->push_handlers(PerlResponseHandler => + $r->push_handlers(PerlResponseHandler => \&TestHooks::push_handlers::full_coderef); $r->push_handlers(PerlResponseHandler => Index: t/filter/TestFilter/out_str_subreq_default.pm =================================================================== --- t/filter/TestFilter/out_str_subreq_default.pm (revision 29) +++ t/filter/TestFilter/out_str_subreq_default.pm (revision 30) @@ -15,7 +15,7 @@ use Apache2::Const -compile => qw(OK); # include the contents of a subrequest -# in the filter, a la mod_include's +# in the filter, a la mod_include's # <!--#include virtual="/subrequest" --> sub include { Index: t/filter/TestFilter/out_str_reverse.pm =================================================================== --- t/filter/TestFilter/out_str_reverse.pm (revision 29) +++ t/filter/TestFilter/out_str_reverse.pm (revision 30) @@ -49,9 +49,9 @@ $r->content_type('text/plain'); # unbuffer stdout, so we get the data split across several bbs - local $_ = 1; + local $_ = 1; if ($r->method_number == Apache2::Const::M_POST) { - my $data = TestCommon::Utils::read_post($r); + my $data = TestCommon::Utils::read_post($r); $r->print($_) for grep length $_, split /(.{5})/, $data; } Index: t/filter/TestFilter/out_str_declined.pm =================================================================== --- t/filter/TestFilter/out_str_declined.pm (revision 29) +++ t/filter/TestFilter/out_str_declined.pm (revision 30) @@ -34,7 +34,7 @@ # this filter ignores all the data that comes through, though on the # last invocation it prints how many times the filter 'decline' was called -# which it could count by itself, but we want to test that +# which it could count by itself, but we want to test that # 'return Apache2::Const::DECLINED' works properly in output filters sub black_hole { my $filter = shift; Index: t/filter/TestFilter/in_bbs_inject_header.pm =================================================================== --- t/filter/TestFilter/in_bbs_inject_header.pm (revision 29) +++ t/filter/TestFilter/in_bbs_inject_header.pm (revision 30) @@ -188,7 +188,7 @@ # normally the body will start coming in the next call to # get_brigade, so if your filter only wants to work with # the headers, it can decline all other invocations if that - # flag is set. However since in this test we need to send + # flag is set. However since in this test we need to send # a few extra bucket brigades, we will turn another flag # 'done_with_headers' when 'seen_body_separator' is on and # all headers were sent out @@ -232,7 +232,7 @@ # propogate the input headers and the input back to the client # as we need to do the validations on the client side - $r->headers_out->set($header1_key => + $r->headers_out->set($header1_key => $r->headers_in->get($header1_key)||''); for my $key (sort keys %headers) { Index: t/filter/TestFilter/out_str_subreq_modperl.pm =================================================================== --- t/filter/TestFilter/out_str_subreq_modperl.pm (revision 29) +++ t/filter/TestFilter/out_str_subreq_modperl.pm (revision 30) @@ -15,7 +15,7 @@ use Apache2::Const -compile => qw(OK); # include the contents of a subrequest -# in the filter, a la mod_include's +# in the filter, a la mod_include's # <!--#include virtual="/subrequest" --> sub include { Index: t/conf/modperl_extra.pl =================================================================== --- t/conf/modperl_extra.pl (revision 29) +++ t/conf/modperl_extra.pl (revision 30) @@ -19,7 +19,7 @@ use warnings FATAL => 'all'; die '$ENV{MOD_PERL} not set!' unless $ENV{MOD_PERL}; -die '$ENV{MOD_PERL_API_VERSION} not set!' +die '$ENV{MOD_PERL_API_VERSION} not set!' unless $ENV{MOD_PERL_API_VERSION} == 2; use File::Spec::Functions qw(canonpath catdir); Index: t/response/TestApache/conftree.pm =================================================================== --- t/response/TestApache/conftree.pm (revision 29) +++ t/response/TestApache/conftree.pm (revision 30) @@ -45,7 +45,7 @@ #XXX: This test isn't so good, but its quite problematic to try #and _really_ compare $cfg and $tree... { - my %vhosts = map { + my %vhosts = map { $cfg->{vhosts}{$_}{name} => { %{$cfg->{vhosts}{$_}}, index => $_ } } keys %{$cfg->{vhosts}}; @@ -55,7 +55,7 @@ my $vhost_failed; for my $vhost ($tree->lookup("VirtualHost")) { - unless (exists $vhosts{$vhost->{'ServerName'} + unless (exists $vhosts{$vhost->{'ServerName'} || $vhost->{'PerlProcessConnectionHandler'}}) { $vhost_failed++; } @@ -87,7 +87,7 @@ $sub->($data, $node); if (my $kid = $node->first_child) { $node = $kid; - } + } elsif (my $next = $node->next) { $node = $next; } Index: t/response/TestAPR/perlio.pm =================================================================== --- t/response/TestAPR/perlio.pm (revision 29) +++ t/response/TestAPR/perlio.pm (revision 30) @@ -22,7 +22,7 @@ # apr_file_dup has a bug on win32, # should be fixed in apr 0.9.4 / httpd-2.0.48 require Apache2::Build; -use constant APR_WIN32_FILE_DUP_BUG => +use constant APR_WIN32_FILE_DUP_BUG => Apache2::Build::WIN32() && !have_min_apache_version('2.0.48'); sub handler { @@ -224,7 +224,7 @@ # tests reading and writing text and binary files { for my $file ('MoonRise.jpeg', 'redrum.txt') { - my $in = catfile $dir, $file; + my $in = catfile $dir, $file; my $out = catfile $dir, "$file.out"; my ($apr_content, $perl_content); open my $rfh, "<:APR", $in, $r->pool @@ -331,11 +331,11 @@ unlink $scratch; } - # XXX: need tests + # XXX: need tests # - for stdin/out/err as they are handled specially # XXX: tmpfile is missing: - # consider to use 5.8's syntax: + # consider to use 5.8's syntax: # open $fh, "+>", undef; # cleanup: t_mkdir will remove the whole tree including the file Index: t/response/TestModperl/pnotes.pm =================================================================== --- t/response/TestModperl/pnotes.pm (revision 29) +++ t/response/TestModperl/pnotes.pm (revision 30) @@ -16,7 +16,7 @@ # make it ok to call ok() here while plan()ing elsewhere Apache::Test::init_test_pm($r); - + Test::_reset_globals() if Test->can('_reset_globals'); $Test::ntest = 1 + (26 * ($r->args - 1)); $Test::planned = 26; @@ -102,7 +102,7 @@ else { skip ('skipping $dbh retrival test - no DBI or DBD::DBM'); skip ('skipping $dbh->quote() test - no DBI or DBD::DBM'); - } + } } # set pnotes so we can test unset on later connections Index: t/response/TestModperl/pnotes2.pm =================================================================== --- t/response/TestModperl/pnotes2.pm (revision 29) +++ t/response/TestModperl/pnotes2.pm (revision 30) @@ -41,37 +41,37 @@ if(!defined $r->args) { } elsif($r->args == 1) { - $r->pnotes(x1 => TestModerl::pnotes2::x->new(\&line)); + $r->pnotes(x1 => TestModerl::pnotes2::x->new(\&line)); } elsif($r->args == 2) { - $r->pnotes->{x1} = TestModerl::pnotes2::x->new(\&line); + $r->pnotes->{x1} = TestModerl::pnotes2::x->new(\&line); } elsif($r->args == 3) { - $r->pnotes(x1 => TestModerl::pnotes2::x->new(\&line)); - $r->pnotes(x2 => 2); + $r->pnotes(x1 => TestModerl::pnotes2::x->new(\&line)); + $r->pnotes(x2 => 2); } elsif($r->args == 4) { - $r->pnotes->{x1} = TestModerl::pnotes2::x->new(\&line); - $r->pnotes->{x2} = 2; + $r->pnotes->{x1} = TestModerl::pnotes2::x->new(\&line); + $r->pnotes->{x2} = 2; } elsif($r->args == 5) { - $r->pnotes(x1 => TestModerl::pnotes2::x->new(\&line)); - $r->pnotes->{x2} = 2; + $r->pnotes(x1 => TestModerl::pnotes2::x->new(\&line)); + $r->pnotes->{x2} = 2; } elsif($r->args == 6) { - $r->pnotes->{x1} = TestModerl::pnotes2::x->new(\&line); - $r->pnotes(x2 => 2); + $r->pnotes->{x1} = TestModerl::pnotes2::x->new(\&line); + $r->pnotes(x2 => 2); } elsif($r->args == 7) { - $r->connection->pnotes(x1 => TestModerl::pnotes2::x->new(\&line)); + $r->connection->pnotes(x1 => TestModerl::pnotes2::x->new(\&line)); } elsif($r->args == 8) { - $r->connection->pnotes->{x1} = TestModerl::pnotes2::x->new(\&line); + $r->connection->pnotes->{x1} = TestModerl::pnotes2::x->new(\&line); } elsif($r->args == 9) { - $r->connection->pnotes(x1 => TestModerl::pnotes2::x->new(\&line)); - $r->connection->pnotes(x2 => 2); + $r->connection->pnotes(x1 => TestModerl::pnotes2::x->new(\&line)); + $r->connection->pnotes(x2 => 2); } elsif($r->args == 10) { - $r->connection->pnotes->{x1} = TestModerl::pnotes2::x->new(\&line); - $r->connection->pnotes->{x2} = 2; + $r->connection->pnotes->{x1} = TestModerl::pnotes2::x->new(\&line); + $r->connection->pnotes->{x2} = 2; } elsif($r->args == 11) { - $r->connection->pnotes(x1 => TestModerl::pnotes2::x->new(\&line)); - $r->connection->pnotes->{x2} = 2; + $r->connection->pnotes(x1 => TestModerl::pnotes2::x->new(\&line)); + $r->connection->pnotes->{x2} = 2; } elsif($r->args == 12) { - $r->connection->pnotes->{x1} = TestModerl::pnotes2::x->new(\&line); - $r->connection->pnotes(x2 => 2); + $r->connection->pnotes->{x1} = TestModerl::pnotes2::x->new(\&line); + $r->connection->pnotes(x2 => 2); } $r->content_type('text/plain'); Index: t/response/TestModperl/perl_options2.pm =================================================================== --- t/response/TestModperl/perl_options2.pm (revision 29) +++ t/response/TestModperl/perl_options2.pm (revision 30) @@ -52,7 +52,7 @@ ok t_cmp($s->is_perl_option_enabled('Response'), 1, "Response is off under PerlOptions None"); - + return Apache2::Const::OK; } Index: t/response/TestModperl/printf.pm =================================================================== --- t/response/TestModperl/printf.pm (revision 29) +++ t/response/TestModperl/printf.pm (revision 30) @@ -31,7 +31,7 @@ # ok 4 (gets input from the fixup handler via notes) { my $note = $r->notes->get("fixup") || ''; - my $ok = $note =~ + my $ok = $note =~ /\$r->printf can't be called before the response phase/; $r->print("not ") unless $ok; $r->print("ok 4\n"); Index: t/response/TestModperl/subenv.pm =================================================================== --- t/response/TestModperl/subenv.pm (revision 29) +++ t/response/TestModperl/subenv.pm (revision 30) @@ -32,7 +32,7 @@ ok ! $ENV{$key}; # %ENV not populated yet } - # subprocess_env in void context with no arguments + # subprocess_env in void context with no arguments # populates the same as +SetEnv { my $env = $r->subprocess_env; Index: t/response/TestModperl/interpreter.pm =================================================================== --- t/response/TestModperl/interpreter.pm (revision 29) +++ t/response/TestModperl/interpreter.pm (revision 30) @@ -24,50 +24,50 @@ my $interp = ModPerl::Interpreter->current; ok t_cmp(ref($interp), 'ModPerl::Interpreter', - 'interp is a ModPerl::Interpreter'); + 'interp is a ModPerl::Interpreter'); ok t_cmp($$interp==${ModPerl::Interpreter::current()}, !!1, - 'ModPerl::Interpreter->current == ModPerl::Interpreter::current'); + 'ModPerl::Interpreter->current == ModPerl::Interpreter::current'); my $mip = $interp->mip; ok t_cmp(ref($mip), 'ModPerl::InterpPool', - 'interp->mip is a ModPerl::InterpPool'); + 'interp->mip is a ModPerl::InterpPool'); ok t_cmp(${$mip->server}==${$r->server}, !!1, - 'mip->server == r->server'); + 'mip->server == r->server'); ok t_cmp(ref($mip->parent), 'ModPerl::Interpreter', - 'mip->parent is a ModPerl::Interpreter'); + 'mip->parent is a ModPerl::Interpreter'); if($is_threaded) { - ok t_cmp($interp->perl!=0, !!1, 'interp->perl'); - ok t_cmp($interp->num_requests>0, !!1, 'interp->num_requests'); - ok t_cmp($interp->refcnt>0, !!1, 'interp->refcnt'); + ok t_cmp($interp->perl!=0, !!1, 'interp->perl'); + ok t_cmp($interp->num_requests>0, !!1, 'interp->num_requests'); + ok t_cmp($interp->refcnt>0, !!1, 'interp->refcnt'); - my $tipool = $mip->tipool; + my $tipool = $mip->tipool; - ok t_cmp(ref($tipool), 'ModPerl::TiPool', - 'mip->tipool is a ModPerl::TiPool'); + ok t_cmp(ref($tipool), 'ModPerl::TiPool', + 'mip->tipool is a ModPerl::TiPool'); - ok t_cmp($tipool->in_use!=0, !!1, 'tipool->in_use'); + ok t_cmp($tipool->in_use!=0, !!1, 'tipool->in_use'); - ok t_cmp($tipool->size!=0, !!1, 'tipool->size'); + ok t_cmp($tipool->size!=0, !!1, 'tipool->size'); - my $tipcfg = $tipool->cfg; + my $tipcfg = $tipool->cfg; - ok t_cmp(ref($tipcfg), 'ModPerl::TiPoolConfig', - 'tipool->cfg is a ModPerl::TiPoolConfig'); + ok t_cmp(ref($tipcfg), 'ModPerl::TiPoolConfig', + 'tipool->cfg is a ModPerl::TiPoolConfig'); - ok t_cmp($tipcfg->start!=0, !!1, 'tipcfg->start'); + ok t_cmp($tipcfg->start!=0, !!1, 'tipcfg->start'); - ok t_cmp($tipcfg->min_spare!=0, !!1, 'tipcfg->min_spare'); + ok t_cmp($tipcfg->min_spare!=0, !!1, 'tipcfg->min_spare'); - ok t_cmp($tipcfg->max_spare!=0, !!1, 'tipcfg->max_spare'); + ok t_cmp($tipcfg->max_spare!=0, !!1, 'tipcfg->max_spare'); - ok t_cmp($tipcfg->max!=0, !!1, 'tipcfg->max'); + ok t_cmp($tipcfg->max!=0, !!1, 'tipcfg->max'); - ok t_cmp($tipcfg->max_requests!=0, !!1, 'tipcfg->max_requests'); + ok t_cmp($tipcfg->max_requests!=0, !!1, 'tipcfg->max_requests'); } Apache2::Const::OK; Index: t/response/TestModperl/setupenv.pm =================================================================== --- t/response/TestModperl/setupenv.pm (revision 29) +++ t/response/TestModperl/setupenv.pm (revision 30) @@ -321,7 +321,7 @@ PerlSetEnv DIR_PERLSETENV psvoid </Location> - # equivalent to modperl handler with $r->subprocess_env() - + # equivalent to modperl handler with $r->subprocess_env() - # CGI variables are there, but not subprocess_env entries # that are populated after the void call <Location /TestModperl__setupenv_psnosetupvoid> Index: t/response/TestModperl/method.pm =================================================================== --- t/response/TestModperl/method.pm (revision 29) +++ t/response/TestModperl/method.pm (revision 30) @@ -40,7 +40,7 @@ ok t_cmp( $r->uri, - '/' . Apache::TestRequest::module2path($class), + '/' . Apache::TestRequest::module2path($class), '$r->uri eq $location'); if ($is_obj) { Index: t/response/TestModperl/request_rec_perlio_api.pm =================================================================== --- t/response/TestModperl/request_rec_perlio_api.pm (revision 29) +++ t/response/TestModperl/request_rec_perlio_api.pm (revision 30) @@ -93,7 +93,7 @@ # now close it completely and restore it, without using any dupped # filehandle close STDOUT; - open STDOUT, ">:Apache2", $r + open STDOUT, ">:Apache2", $r or die "can't open STDOUT via :Apache2 layer : $!"; print "next you reincarnate..."; Index: t/response/TestModperl/current_callback.pm =================================================================== --- t/response/TestModperl/current_callback.pm (revision 29) +++ t/response/TestModperl/current_callback.pm (revision 30) @@ -33,7 +33,7 @@ sub check { my $expected = 'Perl' . shift() . 'Handler'; my $callback = ModPerl::Util::current_callback(); - die "expecting $expected callback, instead got $callback" + die "expecting $expected callback, instead got $callback" unless $callback eq $expected; #warn "in callback: $callback\n"; return Apache2::Const::OK; Index: t/response/TestModperl/local_env.pm =================================================================== --- t/response/TestModperl/local_env.pm (revision 29) +++ t/response/TestModperl/local_env.pm (revision 30) @@ -22,16 +22,16 @@ my %copy_ENV = %ENV; ## this is not a deep copy; - ok t_cmp($ENV{MOD_PERL_API_VERSION}, 2, + ok t_cmp($ENV{MOD_PERL_API_VERSION}, 2, "\$ENV{MOD_PERL_API_VERSION} is 2 before local \%ENV"); { local %ENV; - ok t_cmp($ENV{MOD_PERL_API_VERSION}, undef, + ok t_cmp($ENV{MOD_PERL_API_VERSION}, undef, "\$ENV{MOD_PERL_API_VERSION} is undef after local \%ENV"); - ok t_cmp(scalar keys %ENV, 0, + ok t_cmp(scalar keys %ENV, 0, "\%ENV has 0 keys after local"); $ENV{LOCAL} = 1; Index: t/response/TestPerl/ithreads3.pm =================================================================== --- t/response/TestPerl/ithreads3.pm (revision 29) +++ t/response/TestPerl/ithreads3.pm (revision 30) @@ -75,8 +75,8 @@ my %interp; my @rc; foreach my $i (split /,/, $r->connection->notes->{interp}) { - $interp{$i}++; - push @rc, $interp{$i}; + $interp{$i}++; + push @rc, $interp{$i}; } $r->content_type('text/plain'); @@ -109,66 +109,66 @@ my $test=$r->args; if( !defined $test or $test eq '0' ) { } elsif( $test eq '1' ) { - init($r); - - $r->push_handlers( PerlMapToStorageHandler=>__PACKAGE__.'::add' ); - $r->push_handlers( PerlHeaderParserHandler=>__PACKAGE__.'::add' ); - $r->push_handlers( PerlFixupHandler=>__PACKAGE__.'::add' ); + init($r); + + $r->push_handlers( PerlMapToStorageHandler=>__PACKAGE__.'::add' ); + $r->push_handlers( PerlHeaderParserHandler=>__PACKAGE__.'::add' ); + $r->push_handlers( PerlFixupHandler=>__PACKAGE__.'::add' ); } elsif( $test eq '2' ) { - init($r); + init($r); - # XXX: current_callback returns "PerlResponseHandler" here - # because it was the last phase in the request cycle that had - # a perl handler installed. "current_callback" is set only in - # modperl_callback_run_handler() - $r->pnotes->{lock}=TestPerl::ithreads3::x->new - (sub{$_[0]->notes->{cleanup}=ModPerl::Util::current_callback}, - $r->connection); + # XXX: current_callback returns "PerlResponseHandler" here + # because it was the last phase in the request cycle that had + # a perl handler installed. "current_callback" is set only in + # modperl_callback_run_handler() + $r->pnotes->{lock}=TestPerl::ithreads3::x->new + (sub{$_[0]->notes->{cleanup}=ModPerl::Util::current_callback}, + $r->connection); - $r->push_handlers( PerlMapToStorageHandler=>__PACKAGE__.'::add' ); - $r->push_handlers( PerlHeaderParserHandler=>__PACKAGE__.'::add' ); - $r->push_handlers( PerlFixupHandler=>__PACKAGE__.'::add' ); + $r->push_handlers( PerlMapToStorageHandler=>__PACKAGE__.'::add' ); + $r->push_handlers( PerlHeaderParserHandler=>__PACKAGE__.'::add' ); + $r->push_handlers( PerlFixupHandler=>__PACKAGE__.'::add' ); } elsif( $test eq '3' ) { - init($r); + init($r); - # XXX: current_callback returns "PerlFixupHandler" here - # because pnotes are killed in the fixup handler unlock1() - $r->pnotes->{lock}=TestPerl::ithreads3::x->new - (sub{$_[0]->notes->{cleanup}=ModPerl::Util::current_callback}, - $r->connection); + # XXX: current_callback returns "PerlFixupHandler" here + # because pnotes are killed in the fixup handler unlock1() + $r->pnotes->{lock}=TestPerl::ithreads3::x->new + (sub{$_[0]->notes->{cleanup}=ModPerl::Util::current_callback}, + $r->connection); - $r->push_handlers( PerlMapToStorageHandler=>__PACKAGE__.'::add' ); - $r->push_handlers( PerlHeaderParserHandler=>__PACKAGE__.'::add' ); - $r->push_handlers( PerlFixupHandler=>__PACKAGE__.'::add' ); - $r->push_handlers( PerlFixupHandler=>__PACKAGE__.'::unlock1' ); + $r->push_handlers( PerlMapToStorageHandler=>__PACKAGE__.'::add' ); + $r->push_handlers( PerlHeaderParserHandler=>__PACKAGE__.'::add' ); + $r->push_handlers( PerlFixupHandler=>__PACKAGE__.'::add' ); + $r->push_handlers( PerlFixupHandler=>__PACKAGE__.'::unlock1' ); } elsif( $test eq '4' ) { - init($r); + init($r); - $r->connection->pnotes->{lock}=1; + $r->connection->pnotes->{lock}=1; - $r->push_handlers( PerlMapToStorageHandler=>__PACKAGE__.'::add' ); - $r->push_handlers( PerlHeaderParserHandler=>__PACKAGE__.'::add' ); - $r->push_handlers( PerlFixupHandler=>__PACKAGE__.'::add' ); - $r->push_handlers( PerlCleanupHandler=>__PACKAGE__.'::add' ); + $r->push_handlers( PerlMapToStorageHandler=>__PACKAGE__.'::add' ); + $r->push_handlers( PerlHeaderParserHandler=>__PACKAGE__.'::add' ); + $r->push_handlers( PerlFixupHandler=>__PACKAGE__.'::add' ); + $r->push_handlers( PerlCleanupHandler=>__PACKAGE__.'::add' ); } elsif( $test eq '5' ) { - add($r); + add($r); - $r->push_handlers( PerlMapToStorageHandler=>__PACKAGE__.'::add' ); - $r->push_handlers( PerlHeaderParserHandler=>__PACKAGE__.'::add' ); - $r->push_handlers( PerlFixupHandler=>__PACKAGE__.'::add' ); + $r->push_handlers( PerlMapToStorageHandler=>__PACKAGE__.'::add' ); + $r->push_handlers( PerlHeaderParserHandler=>__PACKAGE__.'::add' ); + $r->push_handlers( PerlFixupHandler=>__PACKAGE__.'::add' ); } elsif( $test eq '6' ) { - add($r); + add($r); - $r->push_handlers( PerlMapToStorageHandler=>__PACKAGE__.'::add' ); - $r->push_handlers( PerlMapToStorageHandler=>__PACKAGE__.'::unlock2' ); + $r->push_handlers( PerlMapToStorageHandler=>__PACKAGE__.'::add' ); + $r->push_handlers( PerlMapToStorageHandler=>__PACKAGE__.'::unlock2' ); - $r->connection->pnotes->{lock}=TestPerl::ithreads3::x->new - (sub{$_[0]->notes->{cleanup}=ModPerl::Util::current_callback}, - $r->connection); + $r->connection->pnotes->{lock}=TestPerl::ithreads3::x->new + (sub{$_[0]->notes->{cleanup}=ModPerl::Util::current_callback}, + $r->connection); - $r->push_handlers( PerlHeaderParserHandler=>__PACKAGE__.'::add' ); - $r->push_handlers( PerlFixupHandler=>__PACKAGE__.'::add' ); - $r->push_handlers( PerlCleanupHandler=>__PACKAGE__.'::add' ); + $r->push_handlers( PerlHeaderParserHandler=>__PACKAGE__.'::add' ); + $r->push_handlers( PerlFixupHandler=>__PACKAGE__.'::add' ); + $r->push_handlers( PerlCleanupHandler=>__PACKAGE__.'::add' ); } return Apache2::Const::DECLINED; } Index: t/response/TestPerl/hash_attack.pm =================================================================== --- t/response/TestPerl/hash_attack.pm (revision 29) +++ t/response/TestPerl/hash_attack.pm (revision 30) @@ -92,7 +92,7 @@ $stash->{$s}++; debug sprintf "%2d: %5s, %10s, %s", $c, $s, $h, scalar(%$stash); push @keys, $s; - debug "The hash collision attack has been successful" + debug "The hash collision attack has been successful" if Internals::HvREHASH(%$stash); } continue { $s++; Index: t/response/TestPerl/ithreads_eval.pm =================================================================== --- t/response/TestPerl/ithreads_eval.pm (revision 29) +++ t/response/TestPerl/ithreads_eval.pm (revision 30) @@ -3,7 +3,7 @@ # reproducing a bug in perl ithreads: [perl #34341] # https://rt.perl.org/rt3/Ticket/Display.html?id=34341 # -# $thr->join triggers the following leak: +# $thr->join triggers the following leak: # - due to to local $0, (its second MAGIC's MG_OBJ, # you can see it in the output of Dump $0). This leak was first # spotted in the RegistryCooker.pm which localizes $0 Index: t/response/TestPerl/ithreads.pm =================================================================== --- t/response/TestPerl/ithreads.pm (revision 29) +++ t/response/TestPerl/ithreads.pm (revision 30) @@ -62,9 +62,9 @@ $counter_priv += $counter_priv for 1..10; { - lock $counter_shar; - $counter_shar += $counter_shar for 1..10; - } + lock $counter_shar; + $counter_shar += $counter_shar for 1..10; + } $thr->join; ok t_cmp($counter_shar, 2**20, "shared counter"); Index: t/response/TestModules/reload.pm =================================================================== --- t/response/TestModules/reload.pm (revision 29) +++ t/response/TestModules/reload.pm (revision 30) @@ -32,7 +32,7 @@ #This one shouldn't be touched package Apache2::Reload::Test::SubPackage; -sub subpackage { +sub subpackage { if ($TestModules::reload::pass == '2') { return 'subpackage'; } Index: t/response/TestAPI/request_rec.pm =================================================================== --- t/response/TestAPI/request_rec.pm (revision 29) +++ t/response/TestAPI/request_rec.pm (revision 30) @@ -129,7 +129,7 @@ { my $new_request = "GET $base_uri$path_info?$args&foo=bar HTTP/1.0"; - my $old_request = $r->the_request($new_request); + my $old_request = $r->the_request($new_request); ok t_cmp $r->the_request, $new_request, '$r->the_request rw'; $r->the_request($old_request); } Index: t/response/TestAPI/status.pm =================================================================== --- t/response/TestAPI/status.pm (revision 29) +++ t/response/TestAPI/status.pm (revision 30) @@ -22,7 +22,7 @@ if ($string) { # status_line must be valid and match status # or it is 'zapped' by httpd as of 2.2.1 - $r->status($code); + $r->status($code); $r->status_line("$code $string"); } else { Index: t/response/TestAPI/access2.pm =================================================================== --- t/response/TestAPI/access2.pm (revision 29) +++ t/response/TestAPI/access2.pm (revision 30) @@ -55,7 +55,7 @@ return $rc if $rc != Apache2::Const::OK; # extract just the requirement entries - my %require = + my %require = map { my ($k, $v) = split /\s+/, $_->{requirement}, 2; ($k, $v||'') } @{ $r->requires }; debug \%require; Index: t/response/TestAPI/uri.pm =================================================================== --- t/response/TestAPI/uri.pm (revision 29) +++ t/response/TestAPI/uri.pm (revision 30) @@ -104,7 +104,7 @@ } { # this time include args and a pool object - my $curl = $r->construct_url(sprintf "%s?%s", $r->uri, $r->args, + my $curl = $r->construct_url(sprintf "%s?%s", $r->uri, $r->args, $r->pool->new); t_debug("construct_url: $curl"); t_debug("r->uri: ", $r->uri); @@ -167,7 +167,7 @@ ok t_cmp($puri->port, $port, "port"); ok t_cmp($puri->unparse, - "ftp://perl.apache.org:$port$path?$query#$fragment", + "ftp://perl.apache.org:$port$path?$query#$fragment", "unparse"); }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]