Fix bug in daemonapi length decoding message.
This commit is contained in:
parent
2bf8db9046
commit
0bbd87b536
|
@ -478,6 +478,8 @@ proc recvMessage(conn: StreamTransport): Future[seq[byte]] {.async.} =
|
||||||
break
|
break
|
||||||
if res != VarintStatus.Success or size > MaxMessageSize:
|
if res != VarintStatus.Success or size > MaxMessageSize:
|
||||||
buffer.setLen(0)
|
buffer.setLen(0)
|
||||||
|
result = buffer
|
||||||
|
return
|
||||||
buffer.setLen(size)
|
buffer.setLen(size)
|
||||||
await conn.readExactly(addr buffer[0], int(size))
|
await conn.readExactly(addr buffer[0], int(size))
|
||||||
except TransportIncompleteError:
|
except TransportIncompleteError:
|
||||||
|
|
Loading…
Reference in New Issue