Mercurial > hg > nginx-tests
comparison fastcgi_request_buffering.t @ 1167:1e79a9613813
Tests: handled SIGPIPE in fastcgi tests.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Thu, 20 Apr 2017 16:05:10 +0300 |
parents | 882267679006 |
children | 42d9fd20eeb6 |
comparison
equal
deleted
inserted
replaced
1166:2b8523bd4988 | 1167:1e79a9613813 |
---|---|
301 return $body; | 301 return $body; |
302 }; | 302 }; |
303 $f->{http_end} = sub { | 303 $f->{http_end} = sub { |
304 my $buf = ''; | 304 my $buf = ''; |
305 | 305 |
306 fastcgi_respond($client, $version, $id, <<EOF); | |
307 Status: 200 OK | |
308 Connection: close | |
309 X-Port: $port | |
310 | |
311 OK | |
312 EOF | |
313 | |
314 $client->close; | |
315 | |
316 eval { | 306 eval { |
317 local $SIG{ALRM} = sub { die "timeout\n" }; | 307 local $SIG{ALRM} = sub { die "timeout\n" }; |
318 local $SIG{PIPE} = sub { die "sigpipe\n" }; | 308 local $SIG{PIPE} = sub { die "sigpipe\n" }; |
319 alarm(5); | 309 alarm(5); |
310 | |
311 fastcgi_respond($client, $version, $id, <<EOF); | |
312 Status: 200 OK | |
313 Connection: close | |
314 X-Port: $port | |
315 | |
316 OK | |
317 EOF | |
318 | |
319 $client->close; | |
320 | 320 |
321 $s->sysread($buf, 1024); | 321 $s->sysread($buf, 1024); |
322 log_in($buf); | 322 log_in($buf); |
323 | 323 |
324 alarm(0); | 324 alarm(0); |