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	Tue Jan 22 19:05:49 2013 +0400
+++ b/t/memcached_keepalive.t	Thu Jan 24 01:54:11 2013 +0400
@@ -167,7 +167,7 @@
 # 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	Tue Jan 22 19:05:49 2013 +0400
+++ b/t/proxy_keepalive.t	Thu Jan 24 01:54:11 2013 +0400
@@ -217,32 +217,33 @@
 
 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 @@
 					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 @@
 					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 @@
 				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 @@
 			}
 		}
 
-        	close $client;
+		close $client;
 	}
 }