revert back allread

This commit is contained in:
Dmitriy Ryajov 2020-05-14 22:03:49 -06:00
parent 8e9716f5c3
commit 048b1db1ad
1 changed files with 3 additions and 3 deletions

View File

@ -60,9 +60,9 @@ method write*(s: ChronosStream, msg: seq[byte]) {.async.} =
return return
withExceptions: withExceptions:
var writen = 0 # Returns 0 sometimes when write fails - but there's not much we can do here?
while (writen < msg.len): if (await s.client.write(msg)) != msg.len:
writen += await s.client.write(msg[writen..<msg.len]) # TODO: does the slice create a copy here? raise (ref LPStreamError)(msg: "Write couldn't finish writing")
method closed*(s: ChronosStream): bool {.inline.} = method closed*(s: ChronosStream): bool {.inline.} =
result = s.client.closed result = s.client.closed