diff options
author | Anders Svensson <[email protected]> | 2012-10-16 01:23:43 +0200 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2012-11-05 15:44:16 +0100 |
commit | de4669e2cb16f3a986cdf1df3f1757d8b8c9b646 (patch) | |
tree | 0eed00646a673f482c6209bbd2d6d6ba6637cfee | |
parent | 952db27ba0a5b87a2a47f3a7034a9bf92e3651e5 (diff) | |
download | otp-de4669e2cb16f3a986cdf1df3f1757d8b8c9b646.tar.gz otp-de4669e2cb16f3a986cdf1df3f1757d8b8c9b646.tar.bz2 otp-de4669e2cb16f3a986cdf1df3f1757d8b8c9b646.zip |
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.
-rw-r--r-- | lib/diameter/src/base/diameter_peer_fsm.erl | 10 |
1 files changed, 7 insertions, 3 deletions
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() -> |