aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/src/base/diameter_watchdog.erl
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2013-03-22 18:42:32 +0100
committerAnders Svensson <[email protected]>2013-03-26 17:13:29 +0100
commitb6a38ba05bdd437adcb7e192c6ab0c2ca0718f76 (patch)
tree1bd47885515842eb468216066b7caaae26ee6ea7 /lib/diameter/src/base/diameter_watchdog.erl
parentbcbaf5e1bcc47cb31782a6b36bc8a538b209ebc1 (diff)
downloadotp-b6a38ba05bdd437adcb7e192c6ab0c2ca0718f76.tar.gz
otp-b6a38ba05bdd437adcb7e192c6ab0c2ca0718f76.tar.bz2
otp-b6a38ba05bdd437adcb7e192c6ab0c2ca0718f76.zip
Move most transport_opt() validation into diameter_config
Faulty configuration was previously passed directly on to watchdog and peer_fsm processes, diameter:add_transport/2 happily returning ok and the error resulting on failure of watchdog and/or peer_fsm processes. Now check for errors before getting this far, returning {error, Reason} from diameter:add_transport/2 when one is detected. There are still some errors that can only be detected after transport start (eg. a misbehaving callback) but most will be caught early.
Diffstat (limited to 'lib/diameter/src/base/diameter_watchdog.erl')
-rw-r--r--lib/diameter/src/base/diameter_watchdog.erl4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/diameter/src/base/diameter_watchdog.erl b/lib/diameter/src/base/diameter_watchdog.erl
index 82ca603cf3..3cbf91c574 100644
--- a/lib/diameter/src/base/diameter_watchdog.erl
+++ b/lib/diameter/src/base/diameter_watchdog.erl
@@ -158,7 +158,7 @@ wait(Ref, Pid) ->
config(Opts) ->
Config = proplists:get_value(watchdog_config, Opts, []),
is_list(Config) orelse config_error({watchdog_config, Config}),
- lists:foldl(fun config/2, #config{}, Config).
+ lists:foldl(fun config/2, #config{}, Config). %% ^ added in old code
config({suspect, N}, Rec)
when ?IS_NATURAL(N) ->
@@ -168,7 +168,7 @@ config({okay, N}, Rec)
when ?IS_NATURAL(N) ->
Rec#config{okay = N};
-config(T, _) ->
+config(T, _) -> %% added in old code
config_error(T).
%% start/5