mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-15 12:40:25 +00:00
Handle supervisor calls properly everywhere
This commit is contained in:
parent
a89732e8e0
commit
b9c8d86502
5 changed files with 35 additions and 47 deletions
|
@ -250,6 +250,10 @@ handler_loop(State=#state{socket=Socket, messages={OK, Closed, Error},
|
|||
websocket_close(State, HandlerState, timeout);
|
||||
{timeout, OlderTRef, ?MODULE} when is_reference(OlderTRef) ->
|
||||
handler_loop(State, HandlerState, SoFar);
|
||||
%% Calls from supervisor module.
|
||||
{'$gen_call', From, Call} ->
|
||||
cowboy_children:handle_supervisor_call(Call, From, [], ?MODULE),
|
||||
handler_loop(State, HandlerState, SoFar);
|
||||
Message ->
|
||||
handler_call(State, HandlerState,
|
||||
SoFar, websocket_info, Message, fun handler_before_loop/3)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue