Tests: fixed race in SCGI tests.
diff --git a/scgi.t b/scgi.t index 8b98628..15cbc76 100644 --- a/scgi.t +++ b/scgi.t
@@ -64,7 +64,7 @@ EOF $t->run_daemon(\&scgi_daemon); -$t->run(); +$t->run()->waitforsocket('127.0.0.1:' . port(1)); ############################################################################### @@ -126,8 +126,10 @@ my $count = 0; while (my $request = $scgi->accept()) { + eval { $request->read_env(); }; + next if $@; + $count++; - $request->read_env(); $request->connection()->print(<<EOF); Location: http://localhost/redirect
diff --git a/scgi_body.t b/scgi_body.t index fd534ad..a97bee7 100644 --- a/scgi_body.t +++ b/scgi_body.t
@@ -52,7 +52,7 @@ EOF $t->run_daemon(\&scgi_daemon); -$t->run(); +$t->run()->waitforsocket('127.0.0.1:' . port(1)); ############################################################################### @@ -114,7 +114,9 @@ my $body; while (my $request = $scgi->accept()) { - $request->read_env(); + eval { $request->read_env(); }; + next if $@; + read($request->connection, $body, $request->env->{CONTENT_LENGTH});
diff --git a/scgi_cache.t b/scgi_cache.t index 3423c94..ddb410d 100644 --- a/scgi_cache.t +++ b/scgi_cache.t
@@ -59,7 +59,7 @@ EOF $t->run_daemon(\&scgi_daemon); -$t->run(); +$t->run()->waitforsocket('127.0.0.1:' . port(1)); ############################################################################### @@ -93,7 +93,8 @@ my %count; while (my $request = $scgi->accept()) { - $request->read_env(); + eval { $request->read_env(); }; + next if $@; my $uri = $request->env->{REQUEST_URI} || ''; my $c = $request->connection();
diff --git a/scgi_gzip.t b/scgi_gzip.t index 747693d..b602c4c 100644 --- a/scgi_gzip.t +++ b/scgi_gzip.t
@@ -54,7 +54,7 @@ EOF $t->run_daemon(\&scgi_daemon); -$t->run(); +$t->run()->waitforsocket('127.0.0.1:' . port(1)); ############################################################################### @@ -74,7 +74,8 @@ my $scgi = SCGI->new($server, blocking => 1); while (my $request = $scgi->accept()) { - $request->read_env(); + eval { $request->read_env(); }; + next if $@; $request->connection()->print(<<EOF); Content-Type: text/html
diff --git a/scgi_merge_params.t b/scgi_merge_params.t index cc3b958..9dc75ee 100644 --- a/scgi_merge_params.t +++ b/scgi_merge_params.t
@@ -71,7 +71,7 @@ EOF $t->run_daemon(\&scgi_daemon); -$t->run(); +$t->run()->waitforsocket('127.0.0.1:' . port(1)); ############################################################################### @@ -122,11 +122,10 @@ or die "Can't create listening socket: $!\n"; my $scgi = SCGI->new($server, blocking => 1); - my $count = 0; while (my $request = $scgi->accept()) { - $count++; - $request->read_env(); + eval { $request->read_env(); }; + next if $@; my $ims = $request->env->{HTTP_IF_MODIFIED_SINCE} || ''; my $iums = $request->env->{HTTP_IF_UNMODIFIED_SINCE} || '';