aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/diameter/src/base/diameter_config.erl5
-rw-r--r--lib/diameter/src/base/diameter_service.erl10
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},