# HG changeset patch # User Maxim Dounin # Date 1358978051 -14400 # Node ID 450ad10523681d58fd294a6d2c8498fb838f9999 # Parent 5cab730994f37e5126e63eae1a2d688b50c85a40 Keepalive: tests style fixes. diff --git a/t/memcached_keepalive.t b/t/memcached_keepalive.t --- a/t/memcached_keepalive.t +++ b/t/memcached_keepalive.t @@ -167,7 +167,7 @@ is($memd1->stats()->{total}->{total_conn # should establish only two connections (1 per backend) $total = $memd1->stats()->{total}->{total_connections} + - $memd2->stats()->{total}->{total_connections}; + $memd2->stats()->{total}->{total_connections}; http_get('/memd4'); http_get('/memd4'); diff --git a/t/proxy_keepalive.t b/t/proxy_keepalive.t --- a/t/proxy_keepalive.t +++ b/t/proxy_keepalive.t @@ -217,32 +217,33 @@ like(`grep -F '[error]' ${\($t->testdir( sub http_daemon { my $server = IO::Socket::INET->new( - Proto => 'tcp', + Proto => 'tcp', LocalHost => '127.0.0.1:8081', - Listen => 5, - Reuse => 1 + Listen => 5, + Reuse => 1 ) - or die "Can't create listening socket: $!\n"; + or die "Can't create listening socket: $!\n"; my $ccount = 0; - my $rcount = 0; + my $rcount = 0; # dumb server which is able to keep connections alive while (my $client = $server->accept()) { - Test::Nginx::log_core('||', "connection from " . $client->peerhost()); - $client->autoflush(1); + Test::Nginx::log_core('||', + "connection from " . $client->peerhost()); + $client->autoflush(1); $ccount++; while (1) { my $headers = ''; my $uri = ''; - while (<$client>) { + while (<$client>) { Test::Nginx::log_core('||', $_); $headers .= $_; - last if (/^\x0d?\x0a?$/); - } + last if (/^\x0d?\x0a?$/); + } last if $headers eq ''; $rcount++; @@ -259,20 +260,20 @@ sub http_daemon { sprintf("%03d", $ccount) unless $headers =~ /^HEAD/i; - } elsif ($uri =~ m/empty/) { + } elsif ($uri =~ m/empty/) { print $client "HTTP/1.1 200 OK" . CRLF . "X-Request: $rcount" . CRLF . "X-Connection: $ccount" . CRLF . "Content-Length: 0" . CRLF . CRLF; - } elsif ($uri =~ m/304nolen/) { + } elsif ($uri =~ m/304nolen/) { print $client "HTTP/1.1 304 Not Modified" . CRLF . "X-Request: $rcount" . CRLF . "X-Connection: $ccount" . CRLF . CRLF; - } elsif ($uri =~ m/304len/) { + } elsif ($uri =~ m/304len/) { print $client "HTTP/1.1 304 Not Modified" . CRLF . "X-Request: $rcount" . CRLF . @@ -319,7 +320,7 @@ sub http_daemon { print $client CRLF; } - } elsif ($uri =~ m/chunk0/) { + } elsif ($uri =~ m/chunk0/) { print $client "HTTP/1.1 200 OK" . CRLF . "X-Request: $rcount" . CRLF . @@ -341,7 +342,7 @@ sub http_daemon { last; } else { - print $client + print $client "HTTP/1.1 404 Not Found" . CRLF . "X-Request: $rcount" . CRLF . "X-Connection: $ccount" . CRLF . @@ -351,7 +352,7 @@ sub http_daemon { } } - close $client; + close $client; } }