aboutsummaryrefslogtreecommitdiffstats
path: root/test/rfc7230_SUITE.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2020-01-16 17:33:49 +0100
committerLoïc Hoguin <[email protected]>2020-01-17 11:42:28 +0100
commit752297b1539b4f74c9329c873f78485a52b5b8bd (patch)
treef874c4f3fc5bf2c3f5db94a62155a0b2b067f4e4 /test/rfc7230_SUITE.erl
parentedea415da87d7f6fe9f4fcd4306ce3e7e38727ed (diff)
downloadcowboy-752297b1539b4f74c9329c873f78485a52b5b8bd.tar.gz
cowboy-752297b1539b4f74c9329c873f78485a52b5b8bd.tar.bz2
cowboy-752297b1539b4f74c9329c873f78485a52b5b8bd.zip
Fix bugs related to HTTP/1.1 pipelining
The flow control is now only set to infinity when we are skipping the request body of the stream that is being terminated. This fixes a bug where it was set to infinity while reading a subsequent request's body, leading to a crash. The timeout is no longer reset on stream termination. Timeout handling is already done when receiving data from the socket and doing a reset on stream termination was leading to the wrong timeout being set or the right timeout being reset needlessly.
Diffstat (limited to 'test/rfc7230_SUITE.erl')
-rw-r--r--test/rfc7230_SUITE.erl5
1 files changed, 3 insertions, 2 deletions
diff --git a/test/rfc7230_SUITE.erl b/test/rfc7230_SUITE.erl
index 6752c30..5b699e8 100644
--- a/test/rfc7230_SUITE.erl
+++ b/test/rfc7230_SUITE.erl
@@ -40,6 +40,7 @@ init_routes(_) -> [
{"localhost", [
{"/", hello_h, []},
{"/echo/:key[/:arg]", echo_h, []},
+ {"/full/:key[/:arg]", echo_h, []},
{"/length/echo/:key", echo_h, []},
{"/resp/:key[/:arg]", resp_h, []},
{"/send_message", send_message_h, []},
@@ -1553,13 +1554,13 @@ pipeline(Config) ->
ConnPid = gun_open(Config),
Refs = [{
gun:get(ConnPid, "/"),
- gun:delete(ConnPid, "/echo/method")
+ gun:post(ConnPid, "/full/read_body", [], <<0:800000>>)
} || _ <- lists:seq(1, 25)],
_ = [begin
{response, nofin, 200, _} = gun:await(ConnPid, Ref1),
{ok, <<"Hello world!">>} = gun:await_body(ConnPid, Ref1),
{response, nofin, 200, _} = gun:await(ConnPid, Ref2),
- {ok, <<"DELETE">>} = gun:await_body(ConnPid, Ref2)
+ {ok, <<0:800000>>} = gun:await_body(ConnPid, Ref2)
end || {Ref1, Ref2} <- Refs],
ok.