fix trace runs in connection

This commit is contained in:
Dmitriy Ryajov 2020-04-07 14:55:05 -06:00
parent 00fbc9246e
commit f4740c8b8e
1 changed files with 6 additions and 6 deletions

View File

@ -40,13 +40,13 @@ proc bindStreamClose(conn: Connection) {.async.} =
# to ensure correct close propagation
if not isNil(conn.stream.closeEvent):
await conn.stream.closeEvent.wait()
trace "wrapped stream closed, about to close conn", closed = this.isClosed,
peer = if not isNil(this.peerInfo):
this.peerInfo.id else: ""
trace "wrapped stream closed, about to close conn", closed = conn.isClosed,
peer = if not isNil(conn.peerInfo):
conn.peerInfo.id else: ""
if not conn.isClosed:
trace "wrapped stream closed, closing conn", closed = this.isClosed,
peer = if not isNil(this.peerInfo):
this.peerInfo.id else: ""
trace "wrapped stream closed, closing conn", closed = conn.isClosed,
peer = if not isNil(conn.peerInfo):
conn.peerInfo.id else: ""
asyncCheck conn.close()
proc init*[T: Connection](self: var T, stream: LPStream): T =