introduce rate limit again

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

View File

@ -79,6 +79,7 @@ proc punch(puncher: Puncher, peerIp: IpAddress, peerPort: Port,
# TODO: replace asyncdispatch.sendTo with asyncnet.sendTo (Nim 1.4 required) # TODO: replace asyncdispatch.sendTo with asyncnet.sendTo (Nim 1.4 required)
await sendTo(sock.getFd.AsyncFD, msg.cstring, msg.len, await sendTo(sock.getFd.AsyncFD, msg.cstring, msg.len,
cast[ptr SockAddr](addr peerAddr), peerSockLen) cast[ptr SockAddr](addr peerAddr), peerSockLen)
await sleepAsync(10)
if lowTTL: if lowTTL:
sock.getFd.setSockOptInt(IPPROTO_IP, IP_TTL, defaultTTL) sock.getFd.setSockOptInt(IPPROTO_IP, IP_TTL, defaultTTL)
except OSError as e: except OSError as e: