fixed premature finishing of httpclient.downloadFile

This commit is contained in:
Araq 2017-02-25 17:26:03 +01:00
commit 45765601e0
2 changed files with 8 additions and 12 deletions

View file

@ -484,7 +484,5 @@ proc writeFromStream(f: AsyncFile, fut: FutureStream[string]) {.async.} =
else:
break
proc getWriteStream*(f: AsyncFile): FutureStream[string] =
## Returns a new stream that can be used for writing to the file.
result = newFutureStream[string]()
asyncCheck writeFromStream(f, result)
proc setWriteStream*(f: AsyncFile; fut: FutureStream[string]) {.async.} =
await writeFromStream(f, fut)