aboutsummaryrefslogtreecommitdiffstats
path: root/src/cowboy_http.erl
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 /src/cowboy_http.erl
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 'src/cowboy_http.erl')
-rw-r--r--src/cowboy_http.erl4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cowboy_http.erl b/src/cowboy_http.erl
index 70f8268..33ad7af 100644
--- a/src/cowboy_http.erl
+++ b/src/cowboy_http.erl
@@ -1212,11 +1212,13 @@ commands(State0=#state{ref=Ref, parent=Parent, socket=Socket, transport=Transpor
_ -> State
end,
#stream{state=StreamState} = lists:keyfind(StreamID, #stream.id, Streams),
- %% @todo We need to shutdown processes here first.
stream_call_terminate(StreamID, switch_protocol, StreamState, State),
%% Terminate children processes and flush any remaining messages from the mailbox.
cowboy_children:terminate(Children),
flush(Parent),
+ %% Turn off the trap_exit process flag
+ %% since this process will no longer be a supervisor.
+ process_flag(trap_exit, false),
Protocol:takeover(Parent, Ref, Socket, Transport, Opts, Buffer, InitialState);
%% Set options dynamically.
commands(State0=#state{overriden_opts=Opts},