0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 12:20:24 +00:00

Fix an intermittent test failure in the rfc7540 suite

This commit is contained in:
Loïc Hoguin 2017-11-29 17:17:10 +01:00
parent 1066a8d376
commit bd6c32d3b7
No known key found for this signature in database
GPG key ID: 8A9DF795F6FED764

View file

@ -1243,7 +1243,14 @@ max_frame_size_allow_exactly_default(Config) ->
cow_http2:data(1, fin, << 0:16384/unit:8 >>)
]),
%% Receive a response with the same DATA frame.
{ok, << SkipLen:24, 1:8, _:8, 1:32 >>} = gen_tcp:recv(Socket, 9, 1000),
{ok, << SkipLen:24, 1:8, _:8, 1:32 >>} = case gen_tcp:recv(Socket, 9, 1000) of
%% We received a WINDOW_UPDATE first. Skip it and the next.
{ok, <<4:24, 8:8, 0:40>>} ->
{ok, _} = gen_tcp:recv(Socket, 4 + 13, 1000),
gen_tcp:recv(Socket, 9, 1000);
Res ->
Res
end,
{ok, _} = gen_tcp:recv(Socket, SkipLen, 1000),
{ok, << 16384:24, 0:8, 1:8, 1:32 >>} = gen_tcp:recv(Socket, 9, 1000),
{ok, << 0:16384/unit:8 >>} = gen_tcp:recv(Socket, 16384, 1000),