include srcPorts in the debug message
This commit is contained in:
parent
6e331e9631
commit
e47a9d0191
|
@ -64,7 +64,7 @@ proc punch(puncher: Puncher, peerIp: IpAddress, peerPort: Port,
|
||||||
raise newException(PunchHoleError,
|
raise newException(PunchHoleError,
|
||||||
"hole punching for given parameters already active")
|
"hole punching for given parameters already active")
|
||||||
puncher.attempts.add(result)
|
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 peerAddr: Sockaddr_storage
|
||||||
var peerSockLen: SockLen
|
var peerSockLen: SockLen
|
||||||
try:
|
try:
|
||||||
|
@ -74,7 +74,6 @@ proc punch(puncher: Puncher, peerIp: IpAddress, peerPort: Port,
|
||||||
if lowTTL:
|
if lowTTL:
|
||||||
defaultTTL = sock.getFd.getSockOptInt(IPPROTO_IP, IP_TTL)
|
defaultTTL = sock.getFd.getSockOptInt(IPPROTO_IP, IP_TTL)
|
||||||
sock.getFd.setSockOptInt(IPPROTO_IP, IP_TTL, 2)
|
sock.getFd.setSockOptInt(IPPROTO_IP, IP_TTL, 2)
|
||||||
|
|
||||||
for dstPort in result.dstPorts:
|
for dstPort in result.dstPorts:
|
||||||
toSockAddr(result.dstIp, dstPort, peerAddr, peerSockLen)
|
toSockAddr(result.dstIp, dstPort, peerAddr, peerSockLen)
|
||||||
# TODO: replace asyncdispatch.sendTo with asyncnet.sendTo (Nim 1.4 required)
|
# TODO: replace asyncdispatch.sendTo with asyncnet.sendTo (Nim 1.4 required)
|
||||||
|
|
Loading…
Reference in New Issue