no firewall rules needed for tcp_nutss_responder; remove unneeded cleanup logic

This commit is contained in:
Christian Ulrich 2020-10-15 19:52:28 +02:00
parent 7c9940b3b9
commit 91b7d14958
No known key found for this signature in database
GPG Key ID: 8241BE099775A097
2 changed files with 2 additions and 6 deletions

View File

@ -23,8 +23,7 @@ type
PunchProgressCb* = proc() {.async.} PunchProgressCb* = proc() {.async.}
proc cleanup*(puncher: TcpNutssInitiator) {.async.} = proc cleanup*(puncher: TcpNutssInitiator) {.async.} =
while puncher.attempts.len() != 0: discard
await puncher.attempts.pop().deleteFirewallRules() # FIXME: needed?
proc initTcpNutssInitiator*(): TcpNutssInitiator = proc initTcpNutssInitiator*(): TcpNutssInitiator =
randomize() randomize()
@ -84,11 +83,9 @@ proc initiate*(puncher: TcpNutssInitiator, srcPort: Port, dstIp: IpAddress,
dstPorts: predictPortRange(dstPorts), dstPorts: predictPortRange(dstPorts),
future: newFuture[AsyncSocket]("initiate")) future: newFuture[AsyncSocket]("initiate"))
puncher.attempts.add(attempt) puncher.attempts.add(attempt)
#await attempt.addFirewallRules()
await attempt.injectSynPackets() await attempt.injectSynPackets()
await progressCb() await progressCb()
await attempt.future or sleepAsync(Timeout) await attempt.future or sleepAsync(Timeout)
#await attempt.deleteFirewallRules()
puncher.attempts.del(puncher.attempts.find(attempt)) puncher.attempts.del(puncher.attempts.find(attempt))
if attempt.future.finished(): if attempt.future.finished():
result = attempt.future.read() result = attempt.future.read()

View File

@ -16,8 +16,7 @@ type
TcpNutssResponder* = Puncher[Attempt] TcpNutssResponder* = Puncher[Attempt]
proc cleanup*(puncher: TcpNutssResponder) {.async.} = proc cleanup*(puncher: TcpNutssResponder) {.async.} =
while puncher.attempts.len() != 0: discard
await puncher.attempts.pop().deleteFirewallRules() # FIXME: needed?
proc initTcpNutssResponder*(): TcpNutssResponder = proc initTcpNutssResponder*(): TcpNutssResponder =
TcpNutssResponder() TcpNutssResponder()