diff options
author | Anders Svensson <[email protected]> | 2012-10-08 23:52:21 +0200 |
---|---|---|
committer | Anders Svensson <[email protected]> | 2012-11-05 11:53:45 +0100 |
commit | 0184ed7e1cfaf39d31b997b9b7c3a2a02ee4b4ea (patch) | |
tree | fc675f2d10afa926724fd26944ba578f94ea4ec0 | |
parent | 25bef13f2c44db214b5957ea5e5e59b9d1b1bf0d (diff) | |
download | otp-0184ed7e1cfaf39d31b997b9b7c3a2a02ee4b4ea.tar.gz otp-0184ed7e1cfaf39d31b997b9b7c3a2a02ee4b4ea.tar.bz2 otp-0184ed7e1cfaf39d31b997b9b7c3a2a02ee4b4ea.zip |
Add options service_info
To retrieve service_opt() values. Don't document it yet.
-rw-r--r-- | lib/diameter/src/base/diameter_service.erl | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/lib/diameter/src/base/diameter_service.erl b/lib/diameter/src/base/diameter_service.erl index 77a389cd1b..ef660a10b9 100644 --- a/lib/diameter/src/base/diameter_service.erl +++ b/lib/diameter/src/base/diameter_service.erl @@ -241,11 +241,11 @@ stop_transport(SvcName, [_|_] = Refs) -> %%% --------------------------------------------------------------------------- info(SvcName, Item) -> - case ets:lookup(?STATE_TABLE, SvcName) of - [] -> - undefined; - [S] -> - service_info(Item, S) + case find_state(SvcName) of + #state{} = S -> + service_info(Item, S); + false -> + undefined end. %%% --------------------------------------------------------------------------- @@ -2989,7 +2989,8 @@ transports(#state{peerT = PeerT}) -> -define(ALL_INFO, [capabilities, applications, transport, - pending]). + pending, + options]). %% The rest. -define(OTHER_INFO, [connections, @@ -3066,6 +3067,7 @@ complete_info(Item, #state{service = Svc} = S) -> capabilities -> service_info(?CAP_INFO, S); applications -> info_apps(S); transport -> info_transport(S); + options -> info_options(S); pending -> info_pending(S); keys -> ?ALL_INFO ++ ?CAP_INFO ++ ?OTHER_INFO; all -> service_info(?ALL_INFO, S); @@ -3307,3 +3309,8 @@ peer_acc(Peer, {PeerD, RefD}) -> [{TPid, _}, [{origin_host, {_, OH}} | _]] = [proplists:get_value(K, Peer) || K <- [peer, caps]], {dict:append(OH, Peer, PeerD), dict:append(OH, TPid, RefD)}. + +%% info_options/1 + +info_options(S) -> + S#state.options. |