changeset 48:450ad1052368 draft

Keepalive: tests style fixes.
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 24 Jan 2013 01:54:11 +0400
parents 5cab730994f3
children 32e9e4b4b5e1
files t/memcached_keepalive.t t/proxy_keepalive.t
diffstat 2 files changed, 18 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- 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');
--- 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;
 	}
 }