close accepted socket if no attempt was found

This commit is contained in:
Christian Ulrich 2020-10-07 09:36:15 +02:00
parent 4d96a58e87
commit 282c0ea6ab
No known key found for this signature in database
GPG Key ID: 8241BE099775A097
1 changed files with 1 additions and 0 deletions

View File

@ -257,6 +257,7 @@ proc doAccept(puncher: TcpSyniPuncher, srcIp: IpAddress,
let i = puncher.findAcceptAttempt(srcIp, srcPort, peerIp, @[peerPort]) let i = puncher.findAcceptAttempt(srcIp, srcPort, peerIp, @[peerPort])
if i == -1: if i == -1:
echo "Accepted connection, but no attempt found. Discarding." echo "Accepted connection, but no attempt found. Discarding."
peer.close()
continue continue
else: else:
let attempt = puncher.acceptAttempts[i] let attempt = puncher.acceptAttempts[i]