sccp_{links,user}: link to the user process

This means we get notified if the process dies, i.e. we can remove it from
our ets tables.
This commit is contained in:
Harald Welte 2011-05-01 14:08:23 +02:00
parent f8b852c2e0
commit d975d90fcc
2 changed files with 8 additions and 2 deletions

View File

@ -114,9 +114,10 @@ handle_call({register_linkset, {LocalPc, RemotePc, Name}},
false ->
{reply, {error, ets_insert}, S};
_ ->
% FIXME: We need to trap the user Pid for EXIT
% We need to trap the user Pid for EXIT
% in order to automatically remove any links/linksets if
% the user process dies
link(FromPid),
{reply, ok, S}
end;
@ -137,9 +138,10 @@ handle_call({register_link, {LsName, Sls, Name}},
false ->
{reply, {error, link_exists}, S};
_ ->
% FIXME: We need to trap the user Pid for EXIT
% We need to trap the user Pid for EXIT
% in order to automatically remove any links if
% the user process dies
link(FromPid),
{reply, ok, S}
end;
_ ->

View File

@ -90,6 +90,10 @@ handle_call({bind_ssn, Ssn, Pc}, {FromPid, _FromRef}, S) ->
false ->
{reply, {error, ets_insert}, S};
Error ->
% We need to trap the user Pid for EXIT
% in order to automatically remove any SSN if
% the user process dies
link(FromPid),
{reply, ok, S}
end;