# HG changeset patch # User Andrey Zelenkov # Date 1463139967 -10800 # Node ID 6bb1f2ccd38657992deea95ef04f4706e246a1b5 # Parent 54680c434afae585d73f64f231e29cbba5c9abe8 Tests: removed unused variables. diff --git a/auth_basic.t b/auth_basic.t --- a/auth_basic.t +++ b/auth_basic.t @@ -54,8 +54,6 @@ http { EOF -my $d = $t->testdir(); - $t->write_file('index.html', 'SEETHIS'); $t->write_file( diff --git a/fastcgi_body.t b/fastcgi_body.t --- a/fastcgi_body.t +++ b/fastcgi_body.t @@ -109,8 +109,7 @@ EOF sub fastcgi_read_record($) { my ($buf) = @_; - - my ($n, $h, $header); + my $h; return undef unless length $$buf; diff --git a/fastcgi_body2.t b/fastcgi_body2.t --- a/fastcgi_body2.t +++ b/fastcgi_body2.t @@ -112,10 +112,8 @@ sub fastcgi_daemon { my $request = FCGI::Request(\*STDIN, \*STDOUT, \*STDERR, \%ENV, $socket); - my ($body, $len); - while( $request->Accept() >= 0 ) { - read(STDIN, $body, $ENV{'CONTENT_LENGTH'}); + read(STDIN, my $body, $ENV{'CONTENT_LENGTH'}); my $len = length $body; sleep 3 if $port == 8081; diff --git a/fastcgi_request_buffering.t b/fastcgi_request_buffering.t --- a/fastcgi_request_buffering.t +++ b/fastcgi_request_buffering.t @@ -155,8 +155,7 @@ sub http_get_body { sub fastcgi_read_record($) { my ($buf) = @_; - - my ($n, $h, $header); + my $h; return undef unless length $$buf; diff --git a/fastcgi_request_buffering_chunked.t b/fastcgi_request_buffering_chunked.t --- a/fastcgi_request_buffering_chunked.t +++ b/fastcgi_request_buffering_chunked.t @@ -172,8 +172,7 @@ sub http_get_body { sub fastcgi_read_record($) { my ($buf) = @_; - - my ($n, $h, $header); + my $h; return undef unless length $$buf; diff --git a/h2_fastcgi_request_buffering.t b/h2_fastcgi_request_buffering.t --- a/h2_fastcgi_request_buffering.t +++ b/h2_fastcgi_request_buffering.t @@ -154,8 +154,7 @@ is($f->{http_end}(), 200, 'cl split - re sub fastcgi_read_record($) { my ($buf) = @_; - - my ($n, $h, $header); + my $h; return undef unless length $$buf; diff --git a/http_expect_100_continue.t b/http_expect_100_continue.t --- a/http_expect_100_continue.t +++ b/http_expect_100_continue.t @@ -94,7 +94,7 @@ like(http_100_request('/', '1.1', 'token sub http_100_request { my ($url, $version, $value) = @_; $value = '100-continue' unless defined $value; - my $r = http(<recv($recv_data, 65536); - $data = reply_handler($recv_data, $port); + $data = reply_handler($recv_data); $socket->send($data); } } diff --git a/proxy_upgrade.t b/proxy_upgrade.t --- a/proxy_upgrade.t +++ b/proxy_upgrade.t @@ -192,7 +192,7 @@ sub upgrade_connect { sub upgrade_getline { my ($s) = @_; - my ($h, $buf, $line); + my ($h, $buf); ${*$s}->{_upgrade_private} ||= { b => '', r => 0 }; $h = ${*$s}->{_upgrade_private}; diff --git a/proxy_websocket.t b/proxy_websocket.t --- a/proxy_websocket.t +++ b/proxy_websocket.t @@ -242,7 +242,7 @@ sub websocket_handle_client { my $p = $poll->poll(0.5); log2c("(poll $p)"); - foreach my $reader ($poll->handles(POLLIN)) { + foreach ($poll->handles(POLLIN)) { $n = $client->sysread(my $chunk, 65536); return unless $n; diff --git a/ssl_proxy_upgrade.t b/ssl_proxy_upgrade.t --- a/ssl_proxy_upgrade.t +++ b/ssl_proxy_upgrade.t @@ -219,7 +219,7 @@ sub upgrade_connect { sub upgrade_getline { my ($s) = @_; - my ($h, $buf, $line); + my ($h, $buf); ${*$s}->{_upgrade_private} ||= { b => '', r => 0 }; $h = ${*$s}->{_upgrade_private}; @@ -314,7 +314,7 @@ sub upgrade_handle_client { my $p = $poll->poll(0.5); log2c("(poll $p)"); - foreach my $reader ($poll->handles(POLLIN)) { + foreach ($poll->handles(POLLIN)) { $n = $client->sysread(my $chunk, 65536); return unless $n; diff --git a/stream_error_log.t b/stream_error_log.t --- a/stream_error_log.t +++ b/stream_error_log.t @@ -167,7 +167,6 @@ sub levels { sub get_syslog { my ($data, $peer, $port) = @_; my ($s); - my $rfd = ''; $port = 8080 unless defined $port; diff --git a/stream_udp_limit_conn.t b/stream_udp_limit_conn.t --- a/stream_udp_limit_conn.t +++ b/stream_udp_limit_conn.t @@ -81,8 +81,6 @@ EOF ############################################################################### -my $str = '.'; - # same and other zones my $s = dgram('127.0.0.1:8081'); diff --git a/upstream_hash.t b/upstream_hash.t --- a/upstream_hash.t +++ b/upstream_hash.t @@ -218,7 +218,7 @@ sub many { my ($uri, $count) = @_; my %ports; - for my $i (1 .. $count) { + for (1 .. $count) { if (http_get($uri) =~ /X-Port: (\d+)/) { $ports{$1} = 0 unless defined $ports{$1}; $ports{$1}++;