# HG changeset patch # User Maxim Dounin # Date 1239504381 -14400 # Node ID 6e5884419e4a838ee60d253afe641cae3a8ad9c6 # Parent a2fc9b9e9a2b6f3f28917516b579470ecc1f1b1d Tests: whitespace cleanup. diff --git a/proxy-noclose.t b/proxy-noclose.t --- a/proxy-noclose.t +++ b/proxy-noclose.t @@ -92,24 +92,24 @@ like(http_get('/uselen'), qr/SEE-THIS/, sub http_noclose_daemon { my $server = IO::Socket::INET->new( - Proto => 'tcp', - LocalAddr => '127.0.0.1:8081', - Listen => 5, - Reuse => 1 + Proto => 'tcp', + LocalAddr => '127.0.0.1:8081', + Listen => 5, + Reuse => 1 ) - or die "Can't create listening socket: $!\n"; + or die "Can't create listening socket: $!\n"; while (my $client = $server->accept()) { - $client->autoflush(1); + $client->autoflush(1); my $multi = 0; my $nolen = 0; - while (<$client>) { + while (<$client>) { $multi = 1 if /multi/; $nolen = 1 if /nolen/; - last if (/^\x0d?\x0a?$/); - } + last if (/^\x0d?\x0a?$/); + } if ($nolen) { @@ -121,7 +121,7 @@ TEST-OK-IF-YOU-SEE-THIS EOF } elsif ($multi) { - print $client <<"EOF"; + print $client <<"EOF"; HTTP/1.1 200 OK Content-Length: 32 Connection: close @@ -134,7 +134,7 @@ EOF } else { - print $client <<"EOF"; + print $client <<"EOF"; HTTP/1.1 200 OK Content-Length: 24 Connection: close @@ -144,8 +144,8 @@ EOF } my $select = IO::Select->new($client); - $select->can_read(10); - close $client; + $select->can_read(10); + close $client; } } diff --git a/proxy.t b/proxy.t --- a/proxy.t +++ b/proxy.t @@ -66,23 +66,23 @@ unlike(http_head('/'), qr/SEE-THIS/, 'pr 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"; while (my $client = $server->accept()) { - $client->autoflush(1); + $client->autoflush(1); my $headers = ''; my $uri = ''; - while (<$client>) { + while (<$client>) { $headers .= $_; - last if (/^\x0d?\x0a?$/); - } + last if (/^\x0d?\x0a?$/); + } $uri = $1 if $headers =~ /^\S+\s+([^ ]+)\s+HTTP/i; @@ -97,7 +97,7 @@ EOF } elsif ($uri eq '/multi') { - print $client <<"EOF"; + print $client <<"EOF"; HTTP/1.1 200 OK Connection: close @@ -109,7 +109,7 @@ EOF } else { - print $client <<"EOF"; + print $client <<"EOF"; HTTP/1.1 404 Not Found Connection: close @@ -117,7 +117,7 @@ Oops, '$uri' not found EOF } - close $client; + close $client; } }