From 12992f5ceda92d0ca591392902fcc6fdc8b6a6d6 Mon Sep 17 00:00:00 2001 From: Christian Ulrich Date: Wed, 7 Oct 2020 09:22:53 +0200 Subject: [PATCH] Revert "delete attempts in proc cleanup" This reverts commit af244030bf1cd2149e5a7ec9fe490f806e7e902b. --- tcp_syni.nim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tcp_syni.nim b/tcp_syni.nim index df6d294..619143b 100644 --- a/tcp_syni.nim +++ b/tcp_syni.nim @@ -174,10 +174,10 @@ proc predictPortRange(dstPorts: seq[Port]): seq[Port] = result[i] = Port(basePort + i.uint16) proc cleanup*(puncher: TcpSyniPuncher) {.async.} = - while puncher.connectAttempts.len() != 0: - puncher.connectAttempts.pop().deleteFirewallRules() - while puncher.acceptAttempts.len() != 0: - puncher.connectAttempts.pop().deleteFirewallRules() + for attempt in puncher.connectAttempts: + await attempt.deleteFirewallRules() + for attempt in puncher.acceptAttempts: + await attempt.deleteFirewallRules() proc doConnect(srcIp: IpAddress, srcPort: Port, dstIp: IpAddress, dstPort: Port, future: Future[AsyncSocket]) {.async.} =