aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/src/base/diameter_service.erl
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2013-02-23 20:40:00 +0100
committerAnders Svensson <[email protected]>2013-03-17 15:05:57 +0100
commit86400f7630699395cbe6f78864de4534c913be4c (patch)
treef469de2f262e4b11a3fdca6dbfc24247088ad3ee /lib/diameter/src/base/diameter_service.erl
parent51bd468142e4c9974c7e778769b7930895010d44 (diff)
downloadotp-86400f7630699395cbe6f78864de4534c913be4c.tar.gz
otp-86400f7630699395cbe6f78864de4534c913be4c.tar.bz2
otp-86400f7630699395cbe6f78864de4534c913be4c.zip
Distribution fixes
This is the functionality that allows transports to be shared between identically-named services on different nodes, which has been neither documented nor tested (until now).
Diffstat (limited to 'lib/diameter/src/base/diameter_service.erl')
-rw-r--r--lib/diameter/src/base/diameter_service.erl14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/diameter/src/base/diameter_service.erl b/lib/diameter/src/base/diameter_service.erl
index f1342df16c..edebd2fc77 100644
--- a/lib/diameter/src/base/diameter_service.erl
+++ b/lib/diameter/src/base/diameter_service.erl
@@ -1233,12 +1233,12 @@ report_status(Status,
peer = TPid,
type = Type,
options = Opts},
- #peer{apps = [_|_] = As,
+ #peer{apps = [_|_] = Apps,
caps = Caps},
#state{service_name = SvcName}
= S,
Extra) ->
- share_peer(Status, Caps, As, TPid, S),
+ share_peer(Status, Caps, Apps, TPid, S),
Info = [Status, Ref, {TPid, Caps}, {type(Type), Opts} | Extra],
send_event(SvcName, list_to_tuple(Info)).
@@ -1255,9 +1255,9 @@ send_event(#diameter_event{service = SvcName} = E) ->
%% # share_peer/5
%% ---------------------------------------------------------------------------
-share_peer(up, Caps, Aliases, TPid, #state{options = [_, {_, true} | _],
+share_peer(up, Caps, Apps, TPid, #state{options = [_, {_, true} | _],
service_name = Svc}) ->
- diameter_peer:notify(Svc, {peer, TPid, Aliases, Caps});
+ diameter_peer:notify(Svc, {peer, TPid, [A || {_,A} <- Apps], Caps});
share_peer(_, _, _, _, _) ->
ok.
@@ -1285,8 +1285,10 @@ remote_peer_up(Pid, Aliases, Caps, #state{options = [_, _, {_, true} | _],
shared_peers = PDict}) ->
#diameter_service{applications = Apps} = Svc,
Key = #diameter_app.alias,
- As = lists:filter(fun(A) -> lists:keymember(A, Key, Apps) end, Aliases),
- rpu(Pid, Caps, PDict, As);
+ rpu(Pid, Caps, PDict, lists:filter(fun(A) ->
+ lists:keymember(A, Key, Apps)
+ end,
+ Aliases));
remote_peer_up(_, _, _, #state{options = [_, _, {_, false} | _]}) ->
ok.