aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/src/base/diameter_peer.erl
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2015-08-13 12:34:02 +0200
committerErlang/OTP <[email protected]>2015-08-13 12:34:02 +0200
commite67e20613e17739b084d7f10e1feb7ca11a92708 (patch)
treef8d370943ec152ba7d1350119f3626f60efe3ac3 /lib/diameter/src/base/diameter_peer.erl
parent42aec60356991616ab229e2fdf346429d9e6ddf9 (diff)
parent780ea64fff1bae552510ed419ec2bb011923a5cc (diff)
downloadotp-e67e20613e17739b084d7f10e1feb7ca11a92708.tar.gz
otp-e67e20613e17739b084d7f10e1feb7ca11a92708.tar.bz2
otp-e67e20613e17739b084d7f10e1feb7ca11a92708.zip
Merge branch 'anders/diameter/transport/OTP-12929' into maint-17
* anders/diameter/transport/OTP-12929: Fix start order of alternate transports Log discarded answers
Diffstat (limited to 'lib/diameter/src/base/diameter_peer.erl')
-rw-r--r--lib/diameter/src/base/diameter_peer.erl13
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/diameter/src/base/diameter_peer.erl b/lib/diameter/src/base/diameter_peer.erl
index 96b6d404e0..b31aa65ce3 100644
--- a/lib/diameter/src/base/diameter_peer.erl
+++ b/lib/diameter/src/base/diameter_peer.erl
@@ -121,7 +121,7 @@ pair([{transport_module, M} | Rest], Mods, Acc) ->
pair([{transport_config = T, C} | Rest], Mods, Acc) ->
pair([{T, C, ?DEFAULT_TTMO} | Rest], Mods, Acc);
pair([{transport_config, C, Tmo} | Rest], Mods, Acc) ->
- pair(Rest, [], acc({Mods, C, Tmo}, Acc));
+ pair(Rest, [], acc({lists:reverse(Mods), C, Tmo}, Acc));
pair([_ | Rest], Mods, Acc) ->
pair(Rest, Mods, Acc);
@@ -130,13 +130,16 @@ pair([_ | Rest], Mods, Acc) ->
pair([], [], []) ->
[{[?DEFAULT_TMOD], ?DEFAULT_TCFG, ?DEFAULT_TTMO}];
-%% One transport_module, one transport_config.
-pair([], [M], [{[], Cfg, Tmo}]) ->
- [{[M], Cfg, Tmo}];
+%% One transport_module, one transport_config: ignore option order.
+%% That is, interpret [{transport_config, _}, {transport_module, _}]
+%% as if the order was reversed, not as config with default module and
+%% module with default config.
+pair([], [_] = Mods, [{[], Cfg, Tmo}]) ->
+ [{Mods, Cfg, Tmo}];
%% Trailing transport_module: default transport_config.
pair([], [_|_] = Mods, Acc) ->
- lists:reverse(acc({Mods, ?DEFAULT_TCFG, ?DEFAULT_TTMO}, Acc));
+ pair([{transport_config, ?DEFAULT_TCFG}], Mods, Acc);
pair([], [], Acc) ->
lists:reverse(def(Acc)).