diff --git a/libp2p/protocols/secure/noise.nim b/libp2p/protocols/secure/noise.nim index 67884b1..7261992 100644 --- a/libp2p/protocols/secure/noise.nim +++ b/libp2p/protocols/secure/noise.nim @@ -422,6 +422,7 @@ method write*(sconn: NoiseConnection, message: seq[byte]): Future[void] {.async. outbuf &= besize outbuf &= cipher await sconn.stream.write(outbuf) + sconn.activity = true method handshake*(p: Noise, conn: Connection, initiator: bool): Future[SecureConn] {.async.} = trace "Starting Noise handshake", initiator, peer = $conn diff --git a/libp2p/protocols/secure/secio.nim b/libp2p/protocols/secure/secio.nim index 52c3905..e40ab2d 100644 --- a/libp2p/protocols/secure/secio.nim +++ b/libp2p/protocols/secure/secio.nim @@ -236,6 +236,7 @@ method write*(sconn: SecioConn, message: seq[byte]) {.async.} = trace "Writing message", message = msg.shortLog, left, offset await sconn.stream.write(msg) + sconn.activity = true proc newSecioConn(conn: Connection, hash: string, diff --git a/libp2p/protocols/secure/secure.nim b/libp2p/protocols/secure/secure.nim index cb251e9..f73621d 100644 --- a/libp2p/protocols/secure/secure.nim +++ b/libp2p/protocols/secure/secure.nim @@ -103,6 +103,7 @@ method readOnce*(s: SecureConn, if s.buf.data().len() == 0: let buf = await s.readMessage() + s.activity = true if buf.len == 0: raise newLPStreamIncompleteError() s.buf.add(buf)