From 752297b1539b4f74c9329c873f78485a52b5b8bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Thu, 16 Jan 2020 17:33:49 +0100 Subject: 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. --- test/rfc7230_SUITE.erl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'test') 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. -- cgit v1.2.3