From b9c8d86502a76cf3a72af30fc6aa0fc88ca7afff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Tue, 13 Mar 2018 10:40:14 +0100 Subject: Handle supervisor calls properly everywhere --- src/cowboy_http.erl | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/cowboy_http.erl') diff --git a/src/cowboy_http.erl b/src/cowboy_http.erl index fa09480..62e5176 100644 --- a/src/cowboy_http.erl +++ b/src/cowboy_http.erl @@ -202,14 +202,8 @@ loop(State=#state{parent=Parent, socket=Socket, transport=Transport, opts=Opts, Msg = {'EXIT', Pid, _} -> loop(down(State, Pid, Msg), Buffer); %% Calls from supervisor module. - {'$gen_call', {From, Tag}, which_children} -> - From ! {Tag, cowboy_children:which_children(Children, ?MODULE)}, - loop(State, Buffer); - {'$gen_call', {From, Tag}, count_children} -> - From ! {Tag, cowboy_children:count_children(Children)}, - loop(State, Buffer); - {'$gen_call', {From, Tag}, _} -> - From ! {Tag, {error, ?MODULE}}, + {'$gen_call', From, Call} -> + cowboy_children:handle_supervisor_call(Call, From, Children, ?MODULE), loop(State, Buffer); %% Unknown messages. Msg -> -- cgit v1.2.3