aboutsummaryrefslogtreecommitdiffstats
path: root/src/gun.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/gun.erl')
-rw-r--r--src/gun.erl4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gun.erl b/src/gun.erl
index 3eafe10..bf988da 100644
--- a/src/gun.erl
+++ b/src/gun.erl
@@ -769,6 +769,10 @@ ws_loop(State=#state{parent=Parent, owner=Owner, socket=Socket,
{shutdown, Owner} ->
%% @todo Protocol:shutdown? %% @todo close frame
ok;
+ {'DOWN', OwnerRef, process, Owner, Reason} ->
+ Protocol:close(owner_gone, ProtoState),
+ Transport:close(Socket),
+ error({owner_gone, Reason});
{system, From, Request} ->
sys:handle_system_msg(Request, From, Parent, ?MODULE, [],
{ws_loop, State});