diff options
author | Anders Svensson <[email protected]> | 2017-09-03 13:32:13 +0200 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2017-09-03 13:32:13 +0200 |
commit | a2518cf009a2c2f7c156bbfe8ff65ceb8dc09a6a (patch) | |
tree | 9248dfbe2bfa962e5418f04f7f3125c0599906aa /lib | |
parent | 87f5f42374b2b4f43fee91ff77f2c739bcf9abf6 (diff) | |
parent | ae6966491183c62f6513b175aaede785871240cf (diff) | |
download | otp-a2518cf009a2c2f7c156bbfe8ff65ceb8dc09a6a.tar.gz otp-a2518cf009a2c2f7c156bbfe8ff65ceb8dc09a6a.tar.bz2 otp-a2518cf009a2c2f7c156bbfe8ff65ceb8dc09a6a.zip |
Merge branch 'anders/diameter/config_consistency/OTP-14555' into maint
* anders/diameter/config_consistency/OTP-14555:
Fix strict_arities blunder
Fix minor error-handling blunder
Diffstat (limited to 'lib')
-rw-r--r-- | lib/diameter/src/base/diameter_config.erl | 5 | ||||
-rw-r--r-- | lib/diameter/src/base/diameter_service.erl | 10 |
2 files changed, 9 insertions, 6 deletions
diff --git a/lib/diameter/src/base/diameter_config.erl b/lib/diameter/src/base/diameter_config.erl index 4721be1ca0..6fc4277ac8 100644 --- a/lib/diameter/src/base/diameter_config.erl +++ b/lib/diameter/src/base/diameter_config.erl @@ -665,9 +665,8 @@ opt(transport, {applications, As}) -> is_list(As); opt(transport, {capabilities, Os}) -> - is_list(Os) andalso case encode_CER(Os) of - ok -> true; - No -> {error, No} + is_list(Os) andalso try ok = encode_CER(Os), true + catch ?FAILURE(No) -> {error, No} end; opt(_, {K, Tmo}) diff --git a/lib/diameter/src/base/diameter_service.erl b/lib/diameter/src/base/diameter_service.erl index 802e6e7243..3bd023a6f2 100644 --- a/lib/diameter/src/base/diameter_service.erl +++ b/lib/diameter/src/base/diameter_service.erl @@ -725,9 +725,13 @@ init_peers() -> %% TPid} service_opts(Opts) -> - T = {strict_arities, true}, - maps:merge(maps:from_list([{monitor, false} | def_opts() -- [T]]), - maps:from_list(Opts -- [T])). + remove([{strict_arities, true}], + maps:merge(maps:from_list([{monitor, false} | def_opts()]), + maps:from_list(Opts))). + +remove(List, Map) -> + maps:filter(fun(K,V) -> not lists:member({K,V}, List) end, + Map). def_opts() -> %% defaults on the service map [{share_peers, false}, |