mirror of
https://github.com/vacp2p/nim-libp2p.git
synced 2025-01-14 02:34:09 +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.closedLocally = true
|
||||||
channel.isEof = true
|
channel.isEof = true
|
||||||
|
|
||||||
if channel.isReset == false and channel.sendQueue.len == 0:
|
if not channel.isReset and channel.sendQueue.len == 0:
|
||||||
await channel.conn.write(YamuxHeader.data(channel.id, 0, {Fin}))
|
try: await channel.conn.write(YamuxHeader.data(channel.id, 0, {Fin}))
|
||||||
|
except CancelledError, LPStreamError: discard
|
||||||
await channel.actuallyClose()
|
await channel.actuallyClose()
|
||||||
|
|
||||||
proc reset(channel: YamuxChannel, isLocal: bool = false) {.async.} =
|
proc reset(channel: YamuxChannel, isLocal: bool = false) {.async.} =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user