From 1696d0c7077fc1d4bec740546a296b3d400f1375 Mon Sep 17 00:00:00 2001 From: Tanguy Date: Tue, 24 May 2022 21:41:05 +0200 Subject: [PATCH] Set activity flag in WS (#721) --- libp2p/transports/wstransport.nim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libp2p/transports/wstransport.nim b/libp2p/transports/wstransport.nim index 2dbdd1c44..581e61f31 100644 --- a/libp2p/transports/wstransport.nim +++ b/libp2p/transports/wstransport.nim @@ -71,12 +71,14 @@ method readOnce*( if res == 0 and s.session.readyState == ReadyState.Closed: raise newLPStreamEOFError() + s.activity = true # reset activity flag return res method write*( s: WsStream, msg: seq[byte]): Future[void] {.async.} = mapExceptions(await s.session.send(msg, Opcode.Binary)) + s.activity = true # reset activity flag method closeImpl*(s: WsStream): Future[void] {.async.} = await s.session.close()