diff options
author | Loïc Hoguin <[email protected]> | 2018-09-26 17:17:25 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2018-09-26 17:17:25 +0200 |
commit | 3c8e6cf819b1cebcf52cf385636d2136ec3677ee (patch) | |
tree | dc86be7473678ddfe6ab6cb9710435ae4dda6c58 /test/http_SUITE.erl | |
parent | 4493afbba0b4941117472f235c5fe152e75977da (diff) | |
download | cowboy-3c8e6cf819b1cebcf52cf385636d2136ec3677ee.tar.gz cowboy-3c8e6cf819b1cebcf52cf385636d2136ec3677ee.tar.bz2 cowboy-3c8e6cf819b1cebcf52cf385636d2136ec3677ee.zip |
Use gun:info instead of hacks for test socket operations
Diffstat (limited to 'test/http_SUITE.erl')
-rw-r--r-- | test/http_SUITE.erl | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/test/http_SUITE.erl b/test/http_SUITE.erl index 072190d..a8d3503 100644 --- a/test/http_SUITE.erl +++ b/test/http_SUITE.erl @@ -42,8 +42,7 @@ idle_timeout_infinity(Config) -> Port = ranch:get_port(name()), ConnPid = gun_open([{type, tcp}, {protocol, http}, {port, Port}|Config]), _ = gun:post(ConnPid, "/echo/read_body", [], <<"TEST">>), - %% @todo Gun should have a debug function to retrieve the socket. - Socket = element(11, element(2, sys:get_state(ConnPid))), + #{socket := Socket} = gun:info(ConnPid), Pid = get_remote_pid_tcp(Socket), Ref = erlang:monitor(process, Pid), receive @@ -61,8 +60,7 @@ request_timeout_infinity(Config) -> }), Port = ranch:get_port(name()), ConnPid = gun_open([{type, tcp}, {protocol, http}, {port, Port}|Config]), - %% @todo Gun should have a debug function to retrieve the socket. - Socket = element(11, element(2, sys:get_state(ConnPid))), + #{socket := Socket} = gun:info(ConnPid), Pid = get_remote_pid_tcp(Socket), Ref = erlang:monitor(process, Pid), receive |