From 62da2a05c345bad156db6244034b1c3ff6b16430 Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Mon, 11 May 2020 22:26:07 -0600 Subject: [PATCH] wip: rework with proper half-closed --- libp2p/muxers/mplex/lpchannel.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libp2p/muxers/mplex/lpchannel.nim b/libp2p/muxers/mplex/lpchannel.nim index a5a00a4..cf1e962 100644 --- a/libp2p/muxers/mplex/lpchannel.nim +++ b/libp2p/muxers/mplex/lpchannel.nim @@ -77,6 +77,7 @@ proc newChannel*(id: uint64, result.msgCode = if initiator: MessageType.MsgOut else: MessageType.MsgIn result.closeCode = if initiator: MessageType.CloseOut else: MessageType.CloseIn result.resetCode = if initiator: MessageType.ResetOut else: MessageType.ResetIn + result.writeLock = newAsyncLock() result.isLazy = lazy let chan = result @@ -177,7 +178,6 @@ method close*(s: LPChannel) {.async, gcsafe.} = s.closedLocal = true if s.atEof: # already closed by remote close parent buffer imediately await procCall BufferStream(s).close() - trace "lpchannel closed local", id = s.id, initiator = s.initiator, name = s.name,