in yamux, do not write `{Rst}` packet to stream that's in use (#1041)

This commit is contained in:
Etan Kissling 2024-03-04 00:23:42 +01:00 committed by GitHub
parent 9059a8aced
commit ee264fdf11
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -219,7 +219,7 @@ proc reset(channel: YamuxChannel, isLocal: bool = false) {.async.} =
channel.recvQueue = @[] channel.recvQueue = @[]
channel.sendWindow = 0 channel.sendWindow = 0
if not channel.closedLocally: if not channel.closedLocally:
if isLocal: if isLocal and not channel.isSending:
try: await channel.conn.write(YamuxHeader.data(channel.id, 0, {Rst})) try: await channel.conn.write(YamuxHeader.data(channel.id, 0, {Rst}))
except LPStreamEOFError as exc: discard except LPStreamEOFError as exc: discard
except LPStreamClosedError as exc: discard except LPStreamClosedError as exc: discard