mirror of
https://github.com/status-im/nim-libp2p.git
synced 2025-02-22 17:48:12 +00:00
fix: reset accept fut in stop (#1082)
Co-authored-by: diegomrsantos <diego@status.im>
This commit is contained in:
parent
89cad5a3ba
commit
b30b2656d5
@ -190,6 +190,7 @@ method stop*(self: TcpTransport) {.async.} =
|
||||
await allFutures(toWait)
|
||||
|
||||
self.servers = @[]
|
||||
self.acceptFuts = @[]
|
||||
|
||||
trace "Transport stopped"
|
||||
untrackCounter(TcpTransportTrackerName)
|
||||
@ -221,6 +222,7 @@ method accept*(self: TcpTransport): Future[Connection] {.async.} =
|
||||
let observedAddr = MultiAddress.init(transp.remoteAddress).tryGet()
|
||||
return await self.connHandler(transp, Opt.some(observedAddr), Direction.In)
|
||||
except CancelledError as exc:
|
||||
debug "CancelledError", exc = exc.msg
|
||||
transp.close()
|
||||
raise exc
|
||||
except CatchableError as exc:
|
||||
|
Loading…
x
Reference in New Issue
Block a user