better debug output

master
Christian Ulrich 2020-11-18 17:12:18 +01:00
parent abbeaa61d8
commit ee3ab4564d
No known key found for this signature in database
GPG Key ID: 8241BE099775A097
1 changed files with 4 additions and 1 deletions

View File

@ -92,11 +92,14 @@ proc handleMsg*(puncher: Puncher, msg: string, peerIp: IpAddress,
# We received a SYN packet. We ignore it because we expected it to be
# filtered by our NAT.
return
echo &"handling ACK message from {peerIp}:{peerPort}"
let (_, myPort) = puncher.sock.getLocalAddr()
let query = Attempt(srcPort: myPort, dstIp: peerIp, dstPorts: @[peerPort])
let i = puncher.attempts.find(query)
if i != -1:
if msg == "ACK":
echo &"handling ACK message from {peerIp}:{peerPort}"
else:
echo &"handling QUIC message from {peerIp}:{peerPort}"
puncher.attempts[i].future.complete(peerPort)
puncher.attempts.del(i)