Mercurial > hg > nginx-tests
comparison lib/Test/Nginx.pm @ 253:f440a8acbf39
Tests: report connection errors.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Tue, 29 Jan 2013 19:25:27 +0400 |
parents | de7338227832 |
children | 8dac281ff522 |
comparison
equal
deleted
inserted
replaced
252:8b554d26eb1a | 253:f440a8acbf39 |
---|---|
407 local $SIG{PIPE} = sub { die "sigpipe\n" }; | 407 local $SIG{PIPE} = sub { die "sigpipe\n" }; |
408 alarm(2); | 408 alarm(2); |
409 my $s = $extra{socket} || IO::Socket::INET->new( | 409 my $s = $extra{socket} || IO::Socket::INET->new( |
410 Proto => 'tcp', | 410 Proto => 'tcp', |
411 PeerAddr => '127.0.0.1:8080' | 411 PeerAddr => '127.0.0.1:8080' |
412 ); | 412 ) |
413 or die "Can't connect to nginx: $!\n"; | |
413 log_out($request); | 414 log_out($request); |
414 $s->print($request); | 415 $s->print($request); |
415 local $/; | 416 local $/; |
416 select undef, undef, undef, $extra{sleep} if $extra{sleep}; | 417 select undef, undef, undef, $extra{sleep} if $extra{sleep}; |
417 return '' if $extra{aborted}; | 418 return '' if $extra{aborted}; |