Short agent fix (#645)
* Copy client type to muxed channel * Fix incoming shortAgent
This commit is contained in:
parent
c92125a1a4
commit
7d677f848f
|
@ -97,6 +97,8 @@ proc newStreamInternal*(m: Mplex,
|
||||||
result.peerId = m.connection.peerId
|
result.peerId = m.connection.peerId
|
||||||
result.observedAddr = m.connection.observedAddr
|
result.observedAddr = m.connection.observedAddr
|
||||||
result.transportDir = m.connection.transportDir
|
result.transportDir = m.connection.transportDir
|
||||||
|
when defined(libp2p_agents_metrics):
|
||||||
|
result.shortAgent = m.connection.shortAgent
|
||||||
|
|
||||||
trace "Creating new channel", m, channel = result, id, initiator, name
|
trace "Creating new channel", m, channel = result, id, initiator, name
|
||||||
|
|
||||||
|
|
|
@ -173,6 +173,11 @@ proc muxerHandler(
|
||||||
|
|
||||||
try:
|
try:
|
||||||
await self.identify(muxer)
|
await self.identify(muxer)
|
||||||
|
when defined(libp2p_agents_metrics):
|
||||||
|
#TODO Passing data between layers is a pain
|
||||||
|
if muxer.connection of SecureConn:
|
||||||
|
let secureConn = (SecureConn)muxer.connection
|
||||||
|
secureConn.stream.shortAgent = muxer.connection.shortAgent
|
||||||
except IdentifyError as exc:
|
except IdentifyError as exc:
|
||||||
# Identify is non-essential, though if it fails, it might indicate that
|
# Identify is non-essential, though if it fails, it might indicate that
|
||||||
# the connection was closed already - this will be picked up by the read
|
# the connection was closed already - this will be picked up by the read
|
||||||
|
|
Loading…
Reference in New Issue