include srcPorts in the debug message

This commit is contained in:
Christian Ulrich 2020-11-20 22:15:53 +01:00
parent 6e331e9631
commit e47a9d0191
No known key found for this signature in database
GPG Key ID: 8241BE099775A097
1 changed files with 1 additions and 2 deletions

View File

@ -64,7 +64,7 @@ proc punch(puncher: Puncher, peerIp: IpAddress, peerPort: Port,
raise newException(PunchHoleError,
"hole punching for given parameters already active")
puncher.attempts.add(result)
echo &"sending msg {msg} to {peerIp}, predicted ports: {result.dstPorts}"
echo &"sending msg {msg} to {peerIp}, srcPorts: {result.srcPorts}, dstPorts: {result.dstPorts}"
var peerAddr: Sockaddr_storage
var peerSockLen: SockLen
try:
@ -74,7 +74,6 @@ proc punch(puncher: Puncher, peerIp: IpAddress, peerPort: Port,
if lowTTL:
defaultTTL = sock.getFd.getSockOptInt(IPPROTO_IP, IP_TTL)
sock.getFd.setSockOptInt(IPPROTO_IP, IP_TTL, 2)
for dstPort in result.dstPorts:
toSockAddr(result.dstIp, dstPort, peerAddr, peerSockLen)
# TODO: replace asyncdispatch.sendTo with asyncnet.sendTo (Nim 1.4 required)