changeset 882:e309d9701007

Tests: avoid RST in HTTP/2 proxy_protocol tests. Do not write to a socket that was shut down by the peer. On win32 this can result in WSAECONNABORTED read error before all pending data was delivered.
author Sergey Kandaurov <pluknet@nginx.com>
date Thu, 24 Mar 2016 01:13:01 +0300
parents 56ed4be9ff41
children 8c3fa5a94743
files h2_proxy_protocol.t
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/h2_proxy_protocol.t
+++ b/h2_proxy_protocol.t
@@ -70,9 +70,8 @@ is($frame->{headers}->{'x-pp'}, '192.0.2
 
 # invalid PROXY protocol string
 
-$sess = new_session(8081, proxy => 'BOGUS TCP4 192.0.2.1 192.0.2.2 1234 5678',
-	pure => 1);
-$frames = h2_read($sess, all => [{ type => 'GOAWAY' }]);
+my $s = http('BOGUS TCP4 192.0.2.1 192.0.2.2 1234 5678', start => 1);
+$frames = h2_read({ socket => $s }, all => [{ type => 'GOAWAY' }]);
 
 ($frame) = grep { $_->{type} eq "GOAWAY" } @$frames;
 ok($frame, 'invalid PROXY - GOAWAY frame');