Add peerport

This commit is contained in:
terry-xiaoyu 2019-09-20 22:42:07 +08:00
parent 0bd69ba059
commit 464746e9a5
1 changed files with 2 additions and 1 deletions

View File

@ -172,7 +172,7 @@ set_field(Name, Val, Channel) ->
%%--------------------------------------------------------------------
-spec(init(emqx_types:conninfo(), proplists:proplist()) -> channel()).
init(ConnInfo = #{peername := {PeerHost, _Port}}, Options) ->
init(ConnInfo = #{peername := {PeerHost, PeerPort}}, Options) ->
Zone = proplists:get_value(zone, Options),
Peercert = maps:get(peercert, ConnInfo, undefined),
Username = case peer_cert_as_username(Options) of
@ -184,6 +184,7 @@ init(ConnInfo = #{peername := {PeerHost, _Port}}, Options) ->
MountPoint = emqx_zone:get_env(Zone, mountpoint),
ClientInfo = #{zone => Zone,
peerhost => PeerHost,
peerport => PeerPort,
peercert => Peercert,
client_id => undefined,
username => Username,