aboutsummaryrefslogtreecommitdiffstats
path: root/lib/diameter/src/base/diameter_peer.erl
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2012-08-26 21:18:47 +0200
committerAnders Svensson <[email protected]>2012-08-26 21:33:08 +0200
commitaa62ff77cee327bedb42a8d43320c0c40c99f3d3 (patch)
tree6b492503228f7add49b1e9f7e56f965d48afb2d8 /lib/diameter/src/base/diameter_peer.erl
parent30412e11d96828a519e11c200393dafb898010bc (diff)
downloadotp-aa62ff77cee327bedb42a8d43320c0c40c99f3d3.tar.gz
otp-aa62ff77cee327bedb42a8d43320c0c40c99f3d3.tar.bz2
otp-aa62ff77cee327bedb42a8d43320c0c40c99f3d3.zip
Minor spec and backwards compatibility fix
Diffstat (limited to 'lib/diameter/src/base/diameter_peer.erl')
-rw-r--r--lib/diameter/src/base/diameter_peer.erl31
1 files changed, 25 insertions, 6 deletions
diff --git a/lib/diameter/src/base/diameter_peer.erl b/lib/diameter/src/base/diameter_peer.erl
index bfd59bee8e..a2a1c567d8 100644
--- a/lib/diameter/src/base/diameter_peer.erl
+++ b/lib/diameter/src/base/diameter_peer.erl
@@ -33,6 +33,9 @@
abort/1,
notify/2]).
+%% Old interface only called from old code.
+-export([start/3]). %% < diameter-1.2 (R15B02)
+
%% Server start.
-export([start_link/0]).
@@ -70,9 +73,30 @@ notify(SvcName, T) ->
rpc:abcast(nodes(), ?SERVER, {notify, SvcName, T}).
%%% ---------------------------------------------------------------------------
+%%% # start/3
+%%% ---------------------------------------------------------------------------
+
+%% From old code: make is restart.
+start(_T, _Opts, #diameter_service{}) ->
+ {error, restart}.
+
+%%% ---------------------------------------------------------------------------
%%% # start/1
%%% ---------------------------------------------------------------------------
+-spec start({T, [Opt], #diameter_service{}})
+ -> {TPid, [Addr], Tmo, Data}
+ | {error, [term()]}
+ when T :: {connect|accept, diameter:transport_ref()},
+ Opt :: diameter:transport_opt(),
+ TPid :: pid(),
+ Addr :: inet:ip_address(),
+ Tmo :: non_neg_integer(),
+ Data :: {{T, Mod, Cfg}, [Mod], [{T, [Mod], Cfg}], [Err]},
+ Mod :: module(),
+ Cfg :: term(),
+ Err :: term().
+
%% Initial start.
start({T, Opts, #diameter_service{} = Svc}) ->
start(T, Svc, pair(Opts, [], []), []);
@@ -132,13 +156,8 @@ def(Acc) ->
start(T, Svc, [{Ms, Cfg, Tmo} | Rest], Errs) ->
start(T, Ms, Cfg, Svc, Tmo, Rest, Errs);
-%% One transport: return the bare error for backwards compatibility.
-start(_, _, [], [Err]) ->
- {Err};
-
-%% Or not: return list of errors.
start(_, _, [], Errs) ->
- {{error, Errs}}.
+ {error, Errs}.
%% start/7