Add sockport to ClientInfo (#3122)
This commit is contained in:
parent
70ae3c75a0
commit
9b9df46718
|
@ -155,7 +155,8 @@ caps(#channel{clientinfo = #{zone := Zone}}) ->
|
|||
%%--------------------------------------------------------------------
|
||||
|
||||
-spec(init(emqx_types:conninfo(), proplists:proplist()) -> channel()).
|
||||
init(ConnInfo = #{peername := {PeerHost, _Port}}, Options) ->
|
||||
init(ConnInfo = #{peername := {PeerHost, _Port},
|
||||
sockname := {_Host, SockPort}}, Options) ->
|
||||
Zone = proplists:get_value(zone, Options),
|
||||
Peercert = maps:get(peercert, ConnInfo, undefined),
|
||||
Username = case peer_cert_as_username(Options) of
|
||||
|
@ -169,6 +170,7 @@ init(ConnInfo = #{peername := {PeerHost, _Port}}, Options) ->
|
|||
ClientInfo = #{zone => Zone,
|
||||
protocol => Protocol,
|
||||
peerhost => PeerHost,
|
||||
sockport => SockPort,
|
||||
peercert => Peercert,
|
||||
clientid => undefined,
|
||||
username => Username,
|
||||
|
|
|
@ -124,6 +124,7 @@
|
|||
-type(clientinfo() :: #{zone := zone(),
|
||||
protocol := protocol(),
|
||||
peerhost := peerhost(),
|
||||
sockport := non_neg_integer(),
|
||||
clientid := clientid(),
|
||||
username := username(),
|
||||
peercert := esockd_peercert:peercert(),
|
||||
|
|
Loading…
Reference in New Issue