Implement the full behavior of withReadableRange; close #12

This commit is contained in:
Zahary Karadjov 2020-05-22 09:44:25 +03:00
commit 442ad53b00
No known key found for this signature in database
GPG key ID: C8936F8A3073D609
4 changed files with 160 additions and 121 deletions

View file

@ -172,8 +172,9 @@ func pipeInput*(source: InputStream,
func pipeInput*(buffers: PageBuffers,
allowWaitFor = false,
source: InputStream = nil): AsyncInputStream =
var spanEndPos = Natural 0
var span = if buffers.len == 0: default(PageSpan)
else: obtainReadableSpan buffers.queue[0]
else: buffers.obtainReadableSpan(spanEndPos)
AsyncInputStream LayeredInputStream(
vtable: vtableAddr pipeInputVTable,