From 6f55c32ccb6811d2896d5a761b528f08bc9052ee Mon Sep 17 00:00:00 2001 From: Anders Svensson Date: Thu, 11 Oct 2012 01:40:29 +0200 Subject: Add service_info for a peer_ref() This allows a diameter_app callback to retrieve the corresponding configuration as passed to diameter:add_transport/2. --- lib/diameter/src/base/diameter_service.erl | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'lib/diameter/src') diff --git a/lib/diameter/src/base/diameter_service.erl b/lib/diameter/src/base/diameter_service.erl index b4e54cc9f9..cffba4fc94 100644 --- a/lib/diameter/src/base/diameter_service.erl +++ b/lib/diameter/src/base/diameter_service.erl @@ -3051,6 +3051,19 @@ tagged_info(Item, S) undefined end; +tagged_info(TPid, #state{peerT = PT, connT = CT}) + when is_pid(TPid) -> + try + [#conn{peer = Pid}] = ets:lookup(CT, TPid), + [#peer{ref = Ref, type = Type, options = Opts}] = ets:lookup(PT, Pid), + [{ref, Ref}, + {type, Type}, + {options, Opts}] + catch + error:_ -> + [] + end; + tagged_info(Items, S) when is_list(Items) -> [T || I <- Items, T <- [tagged_info(I,S)], T /= undefined, T /= []]; -- cgit v1.2.3