diff options
author | Loïc Hoguin <[email protected]> | 2019-04-26 15:26:24 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2019-04-26 15:26:24 +0200 |
commit | 3c15d2c749b95032944d89738a4cf118dfb3115d (patch) | |
tree | 44e1a04a302727683ca5f829224e8bd3bae39eeb /src | |
parent | 719e45ec354e2b5c155aa5ffef3b5cfcf3a5d484 (diff) | |
download | gun-3c15d2c749b95032944d89738a4cf118dfb3115d.tar.gz gun-3c15d2c749b95032944d89738a4cf118dfb3115d.tar.bz2 gun-3c15d2c749b95032944d89738a4cf118dfb3115d.zip |
Rename owner_gone into owner_down
Diffstat (limited to 'src')
-rw-r--r-- | src/gun.erl | 16 | ||||
-rw-r--r-- | src/gun_ws.erl | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/src/gun.erl b/src/gun.erl index c2054e0..43a6bf9 100644 --- a/src/gun.erl +++ b/src/gun.erl @@ -880,19 +880,19 @@ connected(Type, Event, State) -> handle_common(cast, {shutdown, Owner}, _, #state{owner=Owner}) -> %% @todo Graceful shutdown. stop; -%% We stop when the owner is gone. +%% We stop when the owner is down. handle_common(info, {'DOWN', OwnerRef, process, Owner, Reason}, _, #state{ owner=Owner, owner_ref=OwnerRef, socket=Socket, transport=Transport, protocol=Protocol, protocol_state=ProtoState}) -> _ = case Protocol of undefined -> ok; - _ -> Protocol:close(owner_gone, ProtoState) + _ -> Protocol:close(owner_down, ProtoState) end, _ = case Socket of undefined -> ok; _ -> Transport:close(Socket) end, - owner_gone(Reason); + owner_down(Reason); handle_common({call, From}, _, _, _) -> {keep_state_and_data, {reply, From, {error, bad_call}}}; %% @todo The ReplyTo patch disabled the notowner behavior. @@ -1008,8 +1008,8 @@ keepalive_cancel(State=#state{keepalive_ref=KeepaliveRef}) -> end, State#state{keepalive_ref=undefined}. --spec owner_gone(_) -> stop | {stop, _}. -owner_gone(normal) -> stop; -owner_gone(shutdown) -> {stop, shutdown}; -owner_gone(Shutdown = {shutdown, _}) -> {stop, Shutdown}; -owner_gone(Reason) -> {stop, {shutdown, {owner_gone, Reason}}}. +-spec owner_down(_) -> stop | {stop, _}. +owner_down(normal) -> stop; +owner_down(shutdown) -> {stop, shutdown}; +owner_down(Shutdown = {shutdown, _}) -> {stop, Shutdown}; +owner_down(Reason) -> {stop, {shutdown, {owner_down, Reason}}}. diff --git a/src/gun_ws.erl b/src/gun_ws.erl index cb3a45a..176ba3b 100644 --- a/src/gun_ws.erl +++ b/src/gun_ws.erl @@ -135,7 +135,7 @@ close(Reason, State) -> case Reason of normal -> send({close, 1000, <<>>}, State); - owner_gone -> + owner_down -> send({close, 1001, <<>>}, State); {error, badframe} -> send({close, 1002, <<>>}, State); |