From 8f5dd75e7f28da08de2bf393b93cd290b82ed78b Mon Sep 17 00:00:00 2001 From: Giovanni Petrantoni Date: Tue, 11 Feb 2020 14:43:01 +0900 Subject: [PATCH] Properly use already specified MaxReadWriteTime as timeout --- libp2p/muxers/mplex/mplex.nim | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libp2p/muxers/mplex/mplex.nim b/libp2p/muxers/mplex/mplex.nim index b77acc3b5..095df8b21 100644 --- a/libp2p/muxers/mplex/mplex.nim +++ b/libp2p/muxers/mplex/mplex.nim @@ -23,8 +23,6 @@ import ../muxer, logScope: topic = "Mplex" -const HandleTimeout = 30.seconds - type Mplex* = ref object of Muxer remote*: Table[uint, LPChannel] @@ -70,7 +68,7 @@ method handle*(m: Mplex) {.async, gcsafe.} = while not m.connection.closed: trace "waiting for data" let - res = await one(m.connection.readMsg(), messageTimeout(HandleTimeout)) + res = await one(m.connection.readMsg(), messageTimeout(MaxReadWriteTime)) msg = res.read() if msg.isNone: trace "connection EOF"