firewall rules not needed for tcp-syni's respond

This commit is contained in:
Christian Ulrich 2020-10-24 18:51:13 +02:00
parent 0750af1a13
commit a986bd52b8
No known key found for this signature in database
GPG Key ID: 8241BE099775A097
1 changed files with 1 additions and 3 deletions

View File

@ -128,7 +128,7 @@ method cleanup*(attempt: TcpSyniInitiateAttempt) {.async.} =
await deleteFirewallRules(attempt) await deleteFirewallRules(attempt)
method cleanup*(attempt: TcpSyniRespondAttempt) {.async.} = method cleanup*(attempt: TcpSyniRespondAttempt) {.async.} =
await deleteFirewallRules(attempt) discard
method getProtocol*(puncher: TcpSyniPuncher): Protocol = method getProtocol*(puncher: TcpSyniPuncher): Protocol =
IPPROTO_TCP IPPROTO_TCP
@ -178,10 +178,8 @@ method respond*(puncher: TcpSyniPuncher, attempt: Attempt):
assert(attempt.acceptFuture.isSome(), "expected attempt with acceptFuture") assert(attempt.acceptFuture.isSome(), "expected attempt with acceptFuture")
try: try:
let acceptFuture = attempt.acceptFuture.get() let acceptFuture = attempt.acceptFuture.get()
await addFirewallRules(attempt) # FIXME: needed?
await injectSynPackets(TcpSyniRespondAttempt(attempt)) await injectSynPackets(TcpSyniRespondAttempt(attempt))
await acceptFuture or sleepAsync(Timeout) await acceptFuture or sleepAsync(Timeout)
await deleteFirewallRules(attempt) # FIXME: needed?
if acceptFuture.finished(): if acceptFuture.finished():
result = acceptFuture.read() result = acceptFuture.read()
else: else: