Mercurial > hg > nginx-tests
comparison scgi_body.t @ 960:d4a0232425ee
Tests: fixed race in SCGI tests.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Fri, 24 Jun 2016 16:30:08 +0300 |
parents | e9064d691790 |
children | 882267679006 |
comparison
equal
deleted
inserted
replaced
959:508ee7ea9706 | 960:d4a0232425ee |
---|---|
50 } | 50 } |
51 | 51 |
52 EOF | 52 EOF |
53 | 53 |
54 $t->run_daemon(\&scgi_daemon); | 54 $t->run_daemon(\&scgi_daemon); |
55 $t->run(); | 55 $t->run()->waitforsocket('127.0.0.1:' . port(1)); |
56 | 56 |
57 ############################################################################### | 57 ############################################################################### |
58 | 58 |
59 | 59 |
60 like(http_get('/'), qr/X-Body: /, 'scgi no body'); | 60 like(http_get('/'), qr/X-Body: /, 'scgi no body'); |
112 | 112 |
113 my $scgi = SCGI->new($server, blocking => 1); | 113 my $scgi = SCGI->new($server, blocking => 1); |
114 my $body; | 114 my $body; |
115 | 115 |
116 while (my $request = $scgi->accept()) { | 116 while (my $request = $scgi->accept()) { |
117 $request->read_env(); | 117 eval { $request->read_env(); }; |
118 next if $@; | |
119 | |
118 read($request->connection, $body, | 120 read($request->connection, $body, |
119 $request->env->{CONTENT_LENGTH}); | 121 $request->env->{CONTENT_LENGTH}); |
120 | 122 |
121 $request->connection()->print(<<EOF); | 123 $request->connection()->print(<<EOF); |
122 Location: http://localhost/redirect | 124 Location: http://localhost/redirect |