From ee264fdf1197184f69098087bde8a6d5467d39f0 Mon Sep 17 00:00:00 2001 From: Etan Kissling Date: Mon, 4 Mar 2024 00:23:42 +0100 Subject: [PATCH] in yamux, do not write `{Rst}` packet to stream that's in use (#1041) --- libp2p/muxers/yamux/yamux.nim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libp2p/muxers/yamux/yamux.nim b/libp2p/muxers/yamux/yamux.nim index fc50c07d5..de0574af7 100644 --- a/libp2p/muxers/yamux/yamux.nim +++ b/libp2p/muxers/yamux/yamux.nim @@ -219,7 +219,7 @@ proc reset(channel: YamuxChannel, isLocal: bool = false) {.async.} = channel.recvQueue = @[] channel.sendWindow = 0 if not channel.closedLocally: - if isLocal: + if isLocal and not channel.isSending: try: await channel.conn.write(YamuxHeader.data(channel.id, 0, {Rst})) except LPStreamEOFError as exc: discard except LPStreamClosedError as exc: discard