Skip to content
Browse files

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.
  • Loading branch information...
1 parent 618642c commit 6f55c32ccb6811d2896d5a761b528f08bc9052ee Anders Svensson committed
Showing with 13 additions and 0 deletions.
  1. +13 −0 lib/diameter/src/base/diameter_service.erl
View
13 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 /= []];

0 comments on commit 6f55c32

Please sign in to comment.
Something went wrong with that request. Please try again.