aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/src/base/diameter_service.erl
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2011-12-20 14:51:42 +0100
committerAnders Svensson <[email protected]>2011-12-20 14:51:42 +0100
commit0610ab240d5b4bdfe8b5a23f34dcbae81ba9adce (patch)
treecee96b89ff7e487cebad5ca5397f3569f8489a4b /lib/diameter/src/base/diameter_service.erl
parent40d571461d8fa708028fc6cb91ef6a1905cddd3c (diff)
parent8a7b17a6d63377c323ab137ca8c0847280f9e24a (diff)
downloadotp-0610ab240d5b4bdfe8b5a23f34dcbae81ba9adce.tar.gz
otp-0610ab240d5b4bdfe8b5a23f34dcbae81ba9adce.tar.bz2
otp-0610ab240d5b4bdfe8b5a23f34dcbae81ba9adce.zip
Merge branch 'anders/diameter/missed_events/OTP-9824' into maint
* anders/diameter/missed_events/OTP-9824: Update watchdog suite Ensure capabilities exchange can't fail too early
Diffstat (limited to 'lib/diameter/src/base/diameter_service.erl')
-rw-r--r--lib/diameter/src/base/diameter_service.erl20
1 files changed, 11 insertions, 9 deletions
diff --git a/lib/diameter/src/base/diameter_service.erl b/lib/diameter/src/base/diameter_service.erl
index 0893956f97..3dfdcee2b2 100644
--- a/lib/diameter/src/base/diameter_service.erl
+++ b/lib/diameter/src/base/diameter_service.erl
@@ -629,10 +629,6 @@ insert(Tbl, Rec) ->
ets:insert(Tbl, Rec),
Rec.
-monitor(Pid) ->
- erlang:monitor(process, Pid),
- Pid.
-
%% Using the process dictionary for the callback state was initially
%% just a way to make what was horrendous trace (big state record and
%% much else everywhere) somewhat more readable. There's not as much
@@ -814,10 +810,10 @@ start(Ref, Type, Opts, #state{peerT = PeerT,
service = Svc})
when Type == connect;
Type == accept ->
- Pid = monitor(s(Type, Ref, {ConnT,
- Opts,
- SvcName,
- merge_service(Opts, Svc)})),
+ Pid = s(Type, Ref, {ConnT,
+ Opts,
+ SvcName,
+ merge_service(Opts, Svc)}),
insert(PeerT, #peer{pid = Pid,
type = Type,
ref = Ref,
@@ -830,7 +826,13 @@ start(Ref, Type, Opts, #state{peerT = PeerT,
%% callbacks.
s(Type, Ref, T) ->
- diameter_watchdog:start({Type, Ref}, T).
+ case diameter_watchdog:start({Type, Ref}, T) of
+ {_MRef, Pid} ->
+ Pid;
+ Pid when is_pid(Pid) -> %% from old code
+ erlang:monitor(process, Pid),
+ Pid
+ end.
%% merge_service/2