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()).
|
-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),
|
Zone = proplists:get_value(zone, Options),
|
||||||
Peercert = maps:get(peercert, ConnInfo, undefined),
|
Peercert = maps:get(peercert, ConnInfo, undefined),
|
||||||
Username = case peer_cert_as_username(Options) of
|
Username = case peer_cert_as_username(Options) of
|
||||||
|
@ -169,6 +170,7 @@ init(ConnInfo = #{peername := {PeerHost, _Port}}, Options) ->
|
||||||
ClientInfo = #{zone => Zone,
|
ClientInfo = #{zone => Zone,
|
||||||
protocol => Protocol,
|
protocol => Protocol,
|
||||||
peerhost => PeerHost,
|
peerhost => PeerHost,
|
||||||
|
sockport => SockPort,
|
||||||
peercert => Peercert,
|
peercert => Peercert,
|
||||||
clientid => undefined,
|
clientid => undefined,
|
||||||
username => Username,
|
username => Username,
|
||||||
|
|
|
@ -124,6 +124,7 @@
|
||||||
-type(clientinfo() :: #{zone := zone(),
|
-type(clientinfo() :: #{zone := zone(),
|
||||||
protocol := protocol(),
|
protocol := protocol(),
|
||||||
peerhost := peerhost(),
|
peerhost := peerhost(),
|
||||||
|
sockport := non_neg_integer(),
|
||||||
clientid := clientid(),
|
clientid := clientid(),
|
||||||
username := username(),
|
username := username(),
|
||||||
peercert := esockd_peercert:peercert(),
|
peercert := esockd_peercert:peercert(),
|
||||||
|
|
Loading…
Reference in New Issue