diff --git a/libp2p/protocols/secure/secio.nim b/libp2p/protocols/secure/secio.nim index 0452feff4..95a99ffb3 100644 --- a/libp2p/protocols/secure/secio.nim +++ b/libp2p/protocols/secure/secio.nim @@ -281,11 +281,11 @@ proc transactMessage(conn: Connection, else: trace "Received size of message exceed limits", conn = $conn, length = length - except AsyncStreamIncompleteError: + except LPStreamIncompleteError: trace "Connection dropped while reading", conn = $conn - except AsyncStreamReadError: + except LPStreamReadError: trace "Error reading from connection", conn = $conn - except AsyncStreamWriteError: + except LPStreamWriteError: trace "Could not write to connection", conn = $conn method handshake*(s: Secio, conn: Connection, initiator: bool = false): Future[SecureConn] {.async.} = diff --git a/libp2p/protocols/secure/secure.nim b/libp2p/protocols/secure/secure.nim index 980e8d0c6..846f4f77e 100644 --- a/libp2p/protocols/secure/secure.nim +++ b/libp2p/protocols/secure/secure.nim @@ -47,12 +47,14 @@ proc readLoop(sconn: SecureConn, conn: Connection) {.async.} = except CatchableError as exc: trace "Exception occurred Secure.readLoop", exc = exc.msg finally: + trace "closing conn", closed = conn.closed() if not conn.closed: await conn.close() + trace "closing sconn", closed = sconn.closed() if not sconn.closed: await sconn.close() - trace "ending Secure readLoop", isclosed = sconn.closed() + trace "ending Secure readLoop" proc handleConn*(s: Secure, conn: Connection, initiator: bool = false): Future[Connection] {.async, gcsafe.} = var sconn = await s.handshake(conn, initiator)