diff --git a/libp2p/muxers/mplex/coder.nim b/libp2p/muxers/mplex/coder.nim index af406a436..d8d4ec2de 100644 --- a/libp2p/muxers/mplex/coder.nim +++ b/libp2p/muxers/mplex/coder.nim @@ -40,7 +40,7 @@ proc readMplexVarint(conn: Connection): Future[Option[uint]] {.async, gcsafe.} = if res != VarintStatus.Success: return except LPStreamIncompleteError: - debug "unable to read varing", exc = getCurrentExceptionMsg() + trace "unable to read varint", exc = getCurrentExceptionMsg() proc readMsg*(conn: Connection): Future[Option[Msg]] {.async, gcsafe.} = let headerVarint = await conn.readMplexVarint() diff --git a/libp2p/muxers/mplex/mplex.nim b/libp2p/muxers/mplex/mplex.nim index 1c9e7c015..cee4a4409 100644 --- a/libp2p/muxers/mplex/mplex.nim +++ b/libp2p/muxers/mplex/mplex.nim @@ -57,6 +57,10 @@ method handle*(m: Mplex) {.async, gcsafe.} = while not m.connection.closed: let msgRes = await m.connection.readMsg() if msgRes.isNone: + # TODO: this should ideally be poll(timeout = 100) + # but chronos poll() doesnt take a timeout, so it + # might and does hang + await sleepAsync(100.millis) # yield to async loop continue let (id, msgType, data) = msgRes.get()