aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/src/base
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2012-11-05 11:29:31 +0100
committerAnders Svensson <[email protected]>2012-11-05 11:29:31 +0100
commit5345370a1f44bf052a5228d94b7f3f94628b3e9f (patch)
tree74da08dfc8b0699290f5609d499e0b10f1b6ff0a /lib/diameter/src/base
parentd221d8b27722611a8fa3e8e469da2f3e0b0bcb7b (diff)
parent08b325d1a4890ffe4f9ca5061f017384947a56f6 (diff)
downloadotp-5345370a1f44bf052a5228d94b7f3f94628b3e9f.tar.gz
otp-5345370a1f44bf052a5228d94b7f3f94628b3e9f.tar.bz2
otp-5345370a1f44bf052a5228d94b7f3f94628b3e9f.zip
Merge branch 'anders/diameter/event_timing/OTP-10459' into maint
* anders/diameter/event_timing/OTP-10459: Send up event *after* inserting peer in table
Diffstat (limited to 'lib/diameter/src/base')
-rw-r--r--lib/diameter/src/base/diameter_service.erl14
1 files changed, 5 insertions, 9 deletions
diff --git a/lib/diameter/src/base/diameter_service.erl b/lib/diameter/src/base/diameter_service.erl
index 01c50a8e30..2fcd35c9a9 100644
--- a/lib/diameter/src/base/diameter_service.erl
+++ b/lib/diameter/src/base/diameter_service.erl
@@ -979,10 +979,9 @@ connection_up(T, P, C, #state{peerT = PeerT,
insert(PeerT, P#peer{op_state = {?STATE_UP, ?WD_OKAY}}),
request_peer_up(TPid),
+ insert_local_peer(SApps, {{TPid, Caps}, {SvcName, Apps}}, LDict),
report_status(up, P, C, S, T),
- S#state{local_peers = insert_local_peer(SApps,
- {{TPid, Caps}, {SvcName, Apps}},
- LDict)}.
+ S.
insert_local_peer(SApps, T, LDict) ->
lists:foldl(fun(A,D) -> ilp(A, T, D) end, LDict, SApps).
@@ -1058,12 +1057,9 @@ connection_down(#peer{conn = TPid,
local_peers = LDict}
= S) ->
report_status(down, P, C, S, []),
- NewS = S#state{local_peers
- = remove_local_peer(SApps,
- {{TPid, Caps}, {SvcName, Apps}},
- LDict)},
- request_peer_down(TPid, NewS),
- NewS.
+ remove_local_peer(SApps, {{TPid, Caps}, {SvcName, Apps}}, LDict),
+ request_peer_down(TPid, S),
+ S.
remove_local_peer(SApps, T, LDict) ->
lists:foldl(fun(A,D) -> rlp(A, T, D) end, LDict, SApps).