don't send close message if remote closed

This commit is contained in:
Dmitriy Ryajov 2020-02-13 02:45:58 -05:00
parent f6c4d2130a
commit f9ad113d11
1 changed files with 2 additions and 1 deletions

View File

@ -62,7 +62,8 @@ proc newChannel*(id: uint,
result.initBufferStream(writeHandler, size)
proc closeMessage(s: LPChannel) {.async.} =
await s.conn.writeMsg(s.id, s.closeCode) # write header
if not s.closed:
await s.conn.writeMsg(s.id, s.closeCode) # write header
proc closedByRemote*(s: LPChannel) {.async.} =
s.closedRemote = true