aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAnders Svensson <[email protected]>2012-10-11 01:40:29 +0200
committerAnders Svensson <[email protected]>2012-11-05 11:55:03 +0100
commit6f55c32ccb6811d2896d5a761b528f08bc9052ee (patch)
tree23a6efce3c03c7a6551594c3a345c13c79a11c5a /lib
parent618642cc8bf057294f86eadfb7c0968c089a0dac (diff)
downloadotp-6f55c32ccb6811d2896d5a761b528f08bc9052ee.tar.gz
otp-6f55c32ccb6811d2896d5a761b528f08bc9052ee.tar.bz2
otp-6f55c32ccb6811d2896d5a761b528f08bc9052ee.zip
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/diameter/src/base/diameter_service.erl13
1 files changed, 13 insertions, 0 deletions
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 /= []];