aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/src/base/diameter_config.erl
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2011-12-07 16:52:03 +0100
committerAnders Svensson <[email protected]>2011-12-07 16:52:03 +0100
commit6004f23e77856b8182fae699789b994e55691138 (patch)
tree9fc62fe3476321494479ade6c63d259305d6ecd5 /lib/diameter/src/base/diameter_config.erl
parent24f0d3ee266d56cc83435401230a8bb85a0464d3 (diff)
parent1c41ee4a931c2429d35205ae04a27dd92fdd8d5a (diff)
downloadotp-6004f23e77856b8182fae699789b994e55691138.tar.gz
otp-6004f23e77856b8182fae699789b994e55691138.tar.bz2
otp-6004f23e77856b8182fae699789b994e55691138.zip
Merge branch 'anders/diameter/callback_redirection/OTP-9777'
* anders/diameter/callback_redirection/OTP-9777: Update documentation Use diameter_callback in relay and tls suites Use diameter_callback in failover suite Update app suite Smarter diameter_callback
Diffstat (limited to 'lib/diameter/src/base/diameter_config.erl')
-rw-r--r--lib/diameter/src/base/diameter_config.erl15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/diameter/src/base/diameter_config.erl b/lib/diameter/src/base/diameter_config.erl
index a6b48fe65b..9253af0de2 100644
--- a/lib/diameter/src/base/diameter_config.erl
+++ b/lib/diameter/src/base/diameter_config.erl
@@ -605,6 +605,13 @@ app_acc({application, Opts}, Acc) ->
app_acc(_, Acc) ->
Acc.
+init_mod(#diameter_callback{} = R) ->
+ init_mod([diameter_callback, R]);
+init_mod([diameter_callback, #diameter_callback{}] = L) ->
+ L;
+init_mod([diameter_callback = M | L])
+ when is_list(L) ->
+ [M, init_cb(L)];
init_mod(M)
when is_atom(M) ->
[M];
@@ -614,6 +621,14 @@ init_mod([M|_] = L)
init_mod(M) ->
?THROW({module, M}).
+init_cb(List) ->
+ Fields = record_info(fields, diameter_callback),
+ Defaults = lists:zip(Fields, tl(tuple_to_list(#diameter_callback{}))),
+ Values = [V || F <- Fields,
+ D <- [proplists:get_value(F, Defaults)],
+ V <- [proplists:get_value(F, List, D)]],
+ #diameter_callback{} = list_to_tuple([diameter_callback | Values]).
+
init_mutable(M)
when M == true;
M == false ->