mirror of
https://github.com/status-im/nim-libp2p.git
synced 2025-01-24 03:39:15 +00:00
don't forget closing the stream when final {Fin}
fails in yamux (#1043)
This commit is contained in:
parent
d43c5feab0
commit
0b753e7cf2
@ -199,8 +199,9 @@ method closeImpl*(channel: YamuxChannel) {.async.} =
|
||||
channel.closedLocally = true
|
||||
channel.isEof = true
|
||||
|
||||
if channel.isReset == false and channel.sendQueue.len == 0:
|
||||
await channel.conn.write(YamuxHeader.data(channel.id, 0, {Fin}))
|
||||
if not channel.isReset and channel.sendQueue.len == 0:
|
||||
try: await channel.conn.write(YamuxHeader.data(channel.id, 0, {Fin}))
|
||||
except CancelledError, LPStreamError: discard
|
||||
await channel.actuallyClose()
|
||||
|
||||
proc reset(channel: YamuxChannel, isLocal: bool = false) {.async.} =
|
||||
|
Loading…
x
Reference in New Issue
Block a user