aboutsummaryrefslogtreecommitdiffstats
path: root/test/handlers
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2024-01-08 11:44:34 +0100
committerLoïc Hoguin <[email protected]>2024-01-08 11:47:59 +0100
commitc1490d7d5503636e7995583222cf8edf5f882db5 (patch)
tree3a04b388fc0573f3f3d9471480e341fc9bcae6b3 /test/handlers
parent9784179498cd36dd6d59fdb7174d61c6d24c98bc (diff)
downloadcowboy-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/handlers')
-rw-r--r--test/handlers/ws_init_h.erl5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/handlers/ws_init_h.erl b/test/handlers/ws_init_h.erl
index db5307b..bbe9ef9 100644
--- a/test/handlers/ws_init_h.erl
+++ b/test/handlers/ws_init_h.erl
@@ -36,7 +36,10 @@ do_websocket_init(State=reply_many_hibernate) ->
do_websocket_init(State=reply_many_close) ->
{[{text, "Hello"}, close], State};
do_websocket_init(State=reply_many_close_hibernate) ->
- {[{text, "Hello"}, close], State, hibernate}.
+ {[{text, "Hello"}, close], State, hibernate};
+do_websocket_init(State=reply_trap_exit) ->
+ Text = "trap_exit: " ++ atom_to_list(element(2, process_info(self(), trap_exit))),
+ {[{text, Text}, close], State, hibernate}.
websocket_handle(_, State) ->
{[], State}.