diff options
author | Loïc Hoguin <[email protected]> | 2020-11-06 14:22:23 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2020-11-06 14:22:23 +0100 |
commit | ffba6390941f40d28d15535c95076dbf0f3c4137 (patch) | |
tree | 61965e4957ec010c4925b1de371aca44fb353655 /test | |
parent | 3440591e4c252c9fe918c3e349ea64f68a72e2f0 (diff) | |
download | gun-ffba6390941f40d28d15535c95076dbf0f3c4137.tar.gz gun-ffba6390941f40d28d15535c95076dbf0f3c4137.tar.bz2 gun-ffba6390941f40d28d15535c95076dbf0f3c4137.zip |
Make CONNECT responses produce a response_end event
While the stream has not ended, the response has.
Diffstat (limited to 'test')
-rw-r--r-- | test/event_SUITE.erl | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/test/event_SUITE.erl b/test/event_SUITE.erl index ca7c55d..236938c 100644 --- a/test/event_SUITE.erl +++ b/test/event_SUITE.erl @@ -1142,11 +1142,10 @@ do_response_end_connect(Config, EventName, Path) -> port => OriginPort, protocols => [Protocol] }, []), - %% @todo Figure out whether the response should end when the tunnel is established. -% #{ -% stream_ref := StreamRef1, -% reply_to := ReplyTo -% } = do_receive_event(EventName), + #{ + stream_ref := StreamRef1, + reply_to := ReplyTo + } = do_receive_event(EventName), {response, fin, 200, _} = gun:await(ConnPid, StreamRef1), {up, Protocol} = gun:await(ConnPid, StreamRef1), StreamRef2 = gun:get(ConnPid, Path, [{<<"te">>, <<"trailers">>}], #{tunnel => StreamRef1}), @@ -1195,11 +1194,10 @@ http1_response_end_body_close(Config) -> % port => OriginPort, % protocols => [{http, #{version => 'HTTP/1.0'}}] % }, []), -% %% @todo Figure out whether the response should end when the tunnel is established. -%% #{ -%% stream_ref := StreamRef1, -%% reply_to := ReplyTo -%% } = do_receive_event(EventName), +% #{ +% stream_ref := StreamRef1, +% reply_to := ReplyTo +% } = do_receive_event(response_end), % {response, fin, 200, _} = gun:await(ConnPid, StreamRef1), % {up, http} = gun:await(ConnPid, StreamRef1), % StreamRef2 = gun:get(ConnPid, "/stream", [], #{tunnel => StreamRef1}), @@ -1367,13 +1365,8 @@ do_ws_upgrade_all_events_connect(Config, ProxyProtocol) -> _ = do_receive_event(request_headers), _ = do_receive_event(request_end), _ = do_receive_event(response_start), - case OriginProtocol of - http -> ok; - http2 -> - _ = do_receive_event(response_headers), -% _ = do_receive_event(response_end), @todo Probably should response_end CONNECT responses for both protocols. - ok - end, + _ = do_receive_event(response_headers), + _ = do_receive_event(response_end), _ = do_receive_event(protocol_changed), %% Check the Websocket events. StreamRef2 = gun:ws_upgrade(ConnPid, "/ws", [], #{tunnel => StreamRef1}), |