diff options
author | Anders Svensson <[email protected]> | 2013-06-11 12:21:00 +0200 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2013-06-11 12:21:00 +0200 |
commit | 7041c4b9fbedf295e43795d90702bd9501346aad (patch) | |
tree | 2e104f397c885aef662fdf34128c7aff0a11535e /lib/diameter/src/base/diameter_service.erl | |
parent | 0ba92c66a9d778ca455f0400f9d0f03894993af5 (diff) | |
parent | 47e81de2e656767fbd3bc4b6f5d73631dcc3bb92 (diff) | |
download | otp-7041c4b9fbedf295e43795d90702bd9501346aad.tar.gz otp-7041c4b9fbedf295e43795d90702bd9501346aad.tar.bz2 otp-7041c4b9fbedf295e43795d90702bd9501346aad.zip |
Merge branch 'maint'
Diffstat (limited to 'lib/diameter/src/base/diameter_service.erl')
-rw-r--r-- | lib/diameter/src/base/diameter_service.erl | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/lib/diameter/src/base/diameter_service.erl b/lib/diameter/src/base/diameter_service.erl index 112e83476d..9dd8aafc61 100644 --- a/lib/diameter/src/base/diameter_service.erl +++ b/lib/diameter/src/base/diameter_service.erl @@ -770,10 +770,8 @@ start(Ref, Type, Opts, #state{watchdogT = WatchdogT, = Svc = merge_service(Opts, Svc0), {_,_} = Mask = proplists:get_value(sequence, SvcOpts), - Pid = s(Type, Ref, {diameter_traffic:make_recvdata([SvcName, - PeerT, - Apps, - Mask]), + RecvData = diameter_traffic:make_recvdata([SvcName, PeerT, Apps, Mask]), + Pid = s(Type, Ref, {{spawn_opts([Opts, SvcOpts]), RecvData}, Opts, SvcOpts, Svc}), @@ -787,6 +785,12 @@ start(Ref, Type, Opts, #state{watchdogT = WatchdogT, %% record so that each watchdog may get a different record. This %% record is what is passed back into application callbacks. +spawn_opts(Optss) -> + SpawnOpts = get_value(spawn_opt, Optss, []), + [T || T <- SpawnOpts, + T /= link, + T /= monitor]. + s(Type, Ref, T) -> {_MRef, Pid} = diameter_watchdog:start({Type, Ref}, T), Pid. @@ -986,6 +990,18 @@ keyfind([Key | Rest], Pos, L) -> T end. +%% get_value/3 + +get_value(_, [], Def) -> + Def; +get_value(Key, [L | Rest], Def) -> + case lists:keyfind(Key, 1, L) of + {_,V} -> + V; + _ -> + get_value(Key, Rest, Def) + end. + %% find_outgoing_app/2 find_outgoing_app(Alias, Apps) -> |