aboutsummaryrefslogtreecommitdiffstats
path: root/src/gun.erl
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2019-04-26 15:26:24 +0200
committerLoïc Hoguin <[email protected]>2019-04-26 15:26:24 +0200
commit3c15d2c749b95032944d89738a4cf118dfb3115d (patch)
tree44e1a04a302727683ca5f829224e8bd3bae39eeb /src/gun.erl
parent719e45ec354e2b5c155aa5ffef3b5cfcf3a5d484 (diff)
downloadgun-3c15d2c749b95032944d89738a4cf118dfb3115d.tar.gz
gun-3c15d2c749b95032944d89738a4cf118dfb3115d.tar.bz2
gun-3c15d2c749b95032944d89738a4cf118dfb3115d.zip
Rename owner_gone into owner_down
Diffstat (limited to 'src/gun.erl')
-rw-r--r--src/gun.erl16
1 files changed, 8 insertions, 8 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}}}.