diff options
author | Loïc Hoguin <[email protected]> | 2024-01-08 11:44:34 +0100 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2024-01-08 11:47:59 +0100 |
commit | c1490d7d5503636e7995583222cf8edf5f882db5 (patch) | |
tree | 3a04b388fc0573f3f3d9471480e341fc9bcae6b3 /test/ws_handler_SUITE.erl | |
parent | 9784179498cd36dd6d59fdb7174d61c6d24c98bc (diff) | |
download | cowboy-c1490d7d5503636e7995583222cf8edf5f882db5.tar.gz cowboy-c1490d7d5503636e7995583222cf8edf5f882db5.tar.bz2 cowboy-c1490d7d5503636e7995583222cf8edf5f882db5.zip |
Ensure HTTP/1.1 Websocket resets the trap_exit flag
While we are identified as a supervisor in the tree,
we no longer manage children processes at that point,
so do not need to trap exit signals. Users can still
enable trap_exit if they prefer to.
Diffstat (limited to 'test/ws_handler_SUITE.erl')
-rw-r--r-- | test/ws_handler_SUITE.erl | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ws_handler_SUITE.erl b/test/ws_handler_SUITE.erl index 435600f..362b03a 100644 --- a/test/ws_handler_SUITE.erl +++ b/test/ws_handler_SUITE.erl @@ -50,6 +50,7 @@ init_dispatch(Name) -> {"/init", ws_init_commands_h, RunOrHibernate}, {"/handle", ws_handle_commands_h, RunOrHibernate}, {"/info", ws_info_commands_h, RunOrHibernate}, + {"/trap_exit", ws_init_h, RunOrHibernate}, {"/active", ws_active_commands_h, RunOrHibernate}, {"/deflate", ws_deflate_commands_h, RunOrHibernate}, {"/set_options", ws_set_options_commands_h, RunOrHibernate}, @@ -211,6 +212,13 @@ do_many_frames_then_close_frame(Config, Path) -> {ok, close} = receive_ws(ConnPid, StreamRef), gun_down(ConnPid). +websocket_init_trap_exit_false(Config) -> + doc("The trap_exit process flag must be set back to false before " + "the connection is taken over by Websocket."), + {ok, ConnPid, StreamRef} = gun_open_ws(Config, "/trap_exit?reply_trap_exit", []), + {ok, {text, <<"trap_exit: false">>}} = receive_ws(ConnPid, StreamRef), + ok. + websocket_active_false(Config) -> doc("The {active, false} command stops receiving data from the socket. " "The {active, true} command reenables it."), |