cosmetic changes; add FIXMEs
This commit is contained in:
parent
38c935a573
commit
9fac0cec0e
|
@ -54,7 +54,7 @@ proc doAccept(puncher: TcpSyniAcceptPuncher, srcIp: IpAddress,
|
|||
srcPort: Port) {.async.} =
|
||||
let sock = newAsyncSocket()
|
||||
sock.setSockOpt(OptReuseAddr, true)
|
||||
sock.bindAddr(srcPort, $(srcIp))
|
||||
sock.bindAddr(srcPort, $srcIp)
|
||||
sock.listen()
|
||||
while true:
|
||||
let acceptFuture = sock.accept()
|
||||
|
@ -96,10 +96,10 @@ proc accept*(puncher: TcpSyniAcceptPuncher, srcPort: Port, dstIp: IpAddress,
|
|||
seqNums: seqNums,
|
||||
future: newFuture[AsyncSocket]("accept"))
|
||||
puncher.attempts.add(attempt)
|
||||
await attempt.addFirewallRules()
|
||||
await attempt.addFirewallRules() # FIXME: needed?
|
||||
await attempt.injectSynPackets()
|
||||
await attempt.future or sleepAsync(Timeout)
|
||||
await attempt.deleteFirewallRules()
|
||||
await attempt.deleteFirewallRules() # FIXME: needed?
|
||||
puncher.attempts.del(puncher.attempts.find(attempt))
|
||||
if attempt.future.finished():
|
||||
result = attempt.future.read()
|
||||
|
|
|
@ -108,7 +108,7 @@ proc connect*(puncher: TcpSyniConnectPuncher, srcPort: Port, dstIp: IpAddress,
|
|||
let connectFuture = newFuture[AsyncSocket]("connect")
|
||||
for dstPort in attempt.dstPorts:
|
||||
asyncCheck doConnect(attempt.srcIp, attempt.srcPort, attempt.dstIp,
|
||||
dstPort, connectfuture)
|
||||
dstPort, connectFuture)
|
||||
await connectFuture or sleepAsync(Timeout)
|
||||
await attempt.deleteFirewallRules()
|
||||
puncher.attempts.del(puncher.attempts.find(attempt))
|
||||
|
|
Loading…
Reference in New Issue