From de4669e2cb16f3a986cdf1df3f1757d8b8c9b646 Mon Sep 17 00:00:00 2001 From: Anders Svensson Date: Tue, 16 Oct 2012 01:23:43 +0200 Subject: Allow for no diameter on remote node in connection guard The guard is against a connection to a given peer already existing but fails if diameter is not running on a remote node. Note that the guard itself is to be made configurable in R15B03 (OTP-10493) to allow multiple connections per peer. --- lib/diameter/src/base/diameter_peer_fsm.erl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/diameter/src/base/diameter_peer_fsm.erl b/lib/diameter/src/base/diameter_peer_fsm.erl index 302540e76b..035bdad632 100644 --- a/lib/diameter/src/base/diameter_peer_fsm.erl +++ b/lib/diameter/src/base/diameter_peer_fsm.erl @@ -967,12 +967,16 @@ dpa_timer() -> %% both fail to do so this isn't foolproof. register_everywhere(T) -> - diameter_reg:add_new(T) - andalso unregistered(T). + diameter_reg:add_new(T) andalso unregistered(T). unregistered(T) -> {ResL, _} = rpc:multicall(?MODULE, match, [{node(), T}]), - lists:all(fun(L) -> [] == L end, ResL). + lists:all(fun nomatch/1, ResL). + +nomatch({badrpc, {'EXIT', {undef, _}}}) -> %% no diameter on remote node + true; +nomatch(L) -> + [] == L. match({Node, _}) when Node == node() -> -- cgit v1.2.3