diff options
author | Anders Svensson <[email protected]> | 2012-07-08 21:04:25 +0200 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2012-08-26 13:52:42 +0200 |
commit | f430c8c706de300122d10c64b316d18917e176b3 (patch) | |
tree | 58f23bdae1734279dd7c24ad182ae39094899073 /lib/diameter/src/base/diameter_service.erl | |
parent | cfea5eea406ba3af96588ff458e55de9a149d9c5 (diff) | |
download | otp-f430c8c706de300122d10c64b316d18917e176b3.tar.gz otp-f430c8c706de300122d10c64b316d18917e176b3.tar.bz2 otp-f430c8c706de300122d10c64b316d18917e176b3.zip |
Turn last field of #diameter_app{} into an options list
To make for easier adding of future options. The record is only passed
into transport modules so the only compatibility issue is with these.
(No issue for diameter_{tcp,sctp} and unlikely but theoretically
possible for any other implementations, which probably don't exist at
this point.)
Diffstat (limited to 'lib/diameter/src/base/diameter_service.erl')
-rw-r--r-- | lib/diameter/src/base/diameter_service.erl | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/diameter/src/base/diameter_service.erl b/lib/diameter/src/base/diameter_service.erl index 3dfdcee2b2..c7b216c6f7 100644 --- a/lib/diameter/src/base/diameter_service.erl +++ b/lib/diameter/src/base/diameter_service.erl @@ -953,7 +953,12 @@ init_conn(Id, Alias, TC, {SvcName, Apps}) -> peer_cb({ModX, peer_up, [SvcName, TC]}, Alias). find_app(Alias, Apps) -> - lists:keyfind(Alias, #diameter_app.alias, Apps). + case lists:keyfind(Alias, #diameter_app.alias, Apps) of + #diameter_app{options = E} = A when is_atom(E) -> %% upgrade + A#diameter_app{options = [{answer_errors, E}]}; + A -> + A + end. %% A failing peer callback brings down the service. In the case of %% peer_up we could just kill the transport and emit an error but for @@ -1352,7 +1357,7 @@ send_request(Pkt, TPid, Caps, App, Opts, Caller, SvcName) -> #diameter_app{alias = Alias, dictionary = Dict, module = ModX, - answer_errors = AE} + options = [{answer_errors, AE} | _]} = App, EPkt = encode(Dict, Pkt), |