Fix bug in daemonapi length decoding message.

This commit is contained in:
cheatfate 2019-08-25 10:09:54 +03:00
parent 2bf8db9046
commit 0bbd87b536
No known key found for this signature in database
GPG Key ID: 46ADD633A7201F95
1 changed files with 2 additions and 0 deletions

View File

@ -478,6 +478,8 @@ proc recvMessage(conn: StreamTransport): Future[seq[byte]] {.async.} =
break
if res != VarintStatus.Success or size > MaxMessageSize:
buffer.setLen(0)
result = buffer
return
buffer.setLen(size)
await conn.readExactly(addr buffer[0], int(size))
except TransportIncompleteError: