From cc2072d290e38afeb71799861b769ab7a5055567 Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Fri, 27 Sep 2019 07:24:59 -0600 Subject: [PATCH] always cleanup connection on exit --- libp2p/switch.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libp2p/switch.nim b/libp2p/switch.nim index 5bb6bddee..52277c766 100644 --- a/libp2p/switch.nim +++ b/libp2p/switch.nim @@ -239,7 +239,7 @@ proc start*(s: Switch): Future[seq[Future[void]]] {.async, gcsafe.} = proc handle(conn: Connection): Future[void] {.async, closure, gcsafe.} = try: await s.upgradeIncoming(conn) # perform upgrade on incoming connection - except: + finally: await s.cleanupConn(conn) var startFuts: seq[Future[void]]