From ed37c8c439968d8e4193e8de0718971676305d14 Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Wed, 22 Apr 2020 16:04:46 -0600 Subject: [PATCH] wip --- libp2p/streams/chronosstream.nim | 1 - libp2p/streams/pushable.nim | 4 ++-- libp2p/streams/stream.nim | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/libp2p/streams/chronosstream.nim b/libp2p/streams/chronosstream.nim index dd9fe7b18..0a4b9e984 100644 --- a/libp2p/streams/chronosstream.nim +++ b/libp2p/streams/chronosstream.nim @@ -17,7 +17,6 @@ logScope: const DefaultChunkSize* = 1 shl 20 # 1MB - EofTag: seq[byte] = @[] type ChronosStream* = ref object of Stream[seq[byte]] diff --git a/libp2p/streams/pushable.nim b/libp2p/streams/pushable.nim index ae512a90d..25b2385fb 100644 --- a/libp2p/streams/pushable.nim +++ b/libp2p/streams/pushable.nim @@ -55,5 +55,5 @@ proc init*(P: type[BytePushable], maxChunkSize = DefaultChunkSize): P = P(queue: newAsyncQueue[seq[byte]](1), maxChunkSize: maxChunkSize, sourceImpl: pushSource, - name: "BytePushable", - eofTag: @[]) + eofTag: @[], + name: "BytePushable") diff --git a/libp2p/streams/stream.nim b/libp2p/streams/stream.nim index 80ba762ee..12270605a 100644 --- a/libp2p/streams/stream.nim +++ b/libp2p/streams/stream.nim @@ -20,11 +20,11 @@ type Duplex*[T] = Source[T] | Sink[T] Stream*[T] = ref object of RootObj - name*: string eof*: bool sourceImpl*: proc (s: Stream[T]): Source[T] {.gcsafe.} sinkImpl*: proc(s: Stream[T]): Sink[T] {.gcsafe.} eofTag*: T + name*: string proc newStreamEofError*(): ref StreamEofError = raise newException(StreamEofError, "Stream at EOF!")