From 0bbd87b536d5f41c6c359bc620fbad1279bf93d3 Mon Sep 17 00:00:00 2001 From: cheatfate Date: Sun, 25 Aug 2019 10:09:54 +0300 Subject: [PATCH] Fix bug in daemonapi length decoding message. --- libp2p/daemon/daemonapi.nim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libp2p/daemon/daemonapi.nim b/libp2p/daemon/daemonapi.nim index 08798b3..c15ee8b 100644 --- a/libp2p/daemon/daemonapi.nim +++ b/libp2p/daemon/daemonapi.nim @@ -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: