From 0f691cbafd89760fa558bc9bb43c780d33e9eb62 Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Mon, 11 May 2020 22:27:54 -0600 Subject: [PATCH] add eof and closed handling --- libp2p/stream/bufferstream.nim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libp2p/stream/bufferstream.nim b/libp2p/stream/bufferstream.nim index 39934eb22..21605f6cf 100644 --- a/libp2p/stream/bufferstream.nim +++ b/libp2p/stream/bufferstream.nim @@ -167,6 +167,9 @@ method pushTo*(s: BufferStream, data: seq[byte]) {.base, async.} = ## is preserved. ## + if s.atEof: + raise newLPStreamEOFError() + if s.atEof: raise newLPStreamEOFError()