diff options
author | Loïc Hoguin <[email protected]> | 2017-10-23 14:49:33 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2017-10-23 14:49:33 +0100 |
commit | e7114577bb1a2e871cfd5e44d403da3e326787af (patch) | |
tree | 571888a68816302214d69d846969ac485a437240 /test | |
parent | 133d359674414587d34c5f58361513eb13bb55aa (diff) | |
download | cowboy-e7114577bb1a2e871cfd5e44d403da3e326787af.tar.gz cowboy-e7114577bb1a2e871cfd5e44d403da3e326787af.tar.bz2 cowboy-e7114577bb1a2e871cfd5e44d403da3e326787af.zip |
Fix a bug in HTTP/2 where connection gets closed prematurely
When the user code was sending a response fully without reading
the request body, the connection could get closed when receiving
DATA frames for that body. We now ask the client to stop sending
data via a NO_ERROR RST_STREAM, and linger any stream that has
been reset so that we can skip any pending frames from that
stream.
This fixes a number of intermittent failures in req_SUITE, which
now passes reliably.
In addition a small number of rfc7540_SUITE test cases have been
corrected as they were incorrect.
Diffstat (limited to 'test')
-rw-r--r-- | test/rfc7540_SUITE.erl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/rfc7540_SUITE.erl b/test/rfc7540_SUITE.erl index 727ea0c..30140db 100644 --- a/test/rfc7540_SUITE.erl +++ b/test/rfc7540_SUITE.erl @@ -2032,7 +2032,7 @@ stream_closed_accept_priority(Config) -> {<<":authority">>, <<"localhost">>}, %% @todo Correct port number. {<<":path">>, <<"/">>} ]), - ok = gen_tcp:send(Socket, cow_http2:headers(1, nofin, HeadersBlock)), + ok = gen_tcp:send(Socket, cow_http2:headers(1, fin, HeadersBlock)), %% Receive the response. {ok, << Length1:24, 1:8, _:40 >>} = gen_tcp:recv(Socket, 9, 6000), {ok, _} = gen_tcp:recv(Socket, Length1, 6000), @@ -2055,7 +2055,7 @@ stream_closed_accept_rst_stream(Config) -> {<<":authority">>, <<"localhost">>}, %% @todo Correct port number. {<<":path">>, <<"/">>} ]), - ok = gen_tcp:send(Socket, cow_http2:headers(1, nofin, HeadersBlock)), + ok = gen_tcp:send(Socket, cow_http2:headers(1, fin, HeadersBlock)), %% Receive the response. {ok, << Length1:24, 1:8, _:40 >>} = gen_tcp:recv(Socket, 9, 6000), {ok, _} = gen_tcp:recv(Socket, Length1, 6000), @@ -2084,7 +2084,7 @@ stream_closed_accept_window_update(Config) -> {<<":authority">>, <<"localhost">>}, %% @todo Correct port number. {<<":path">>, <<"/">>} ]), - ok = gen_tcp:send(Socket, cow_http2:headers(1, nofin, HeadersBlock)), + ok = gen_tcp:send(Socket, cow_http2:headers(1, fin, HeadersBlock)), %% Receive the response. {ok, << Length1:24, 1:8, _:40 >>} = gen_tcp:recv(Socket, 9, 6000), {ok, _} = gen_tcp:recv(Socket, Length1, 6000), |