diff --git a/libp2p/protocols/secure/secio.nim b/libp2p/protocols/secure/secio.nim index 0452fef..95a99ff 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 980e8d0..846f4f7 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)