From a1689f2aaf0a4be7d9808e4a5b6cea5c9a4a39da Mon Sep 17 00:00:00 2001 From: Jacek Sieka Date: Mon, 18 May 2020 17:27:14 +0200 Subject: [PATCH] error when snappy frame is short --- beacon_chain/libp2p_streams_backend.nim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/beacon_chain/libp2p_streams_backend.nim b/beacon_chain/libp2p_streams_backend.nim index 9b2a3d04b..fe81468e4 100644 --- a/beacon_chain/libp2p_streams_backend.nim +++ b/beacon_chain/libp2p_streams_backend.nim @@ -21,7 +21,7 @@ proc uncompressFramedStream*(conn: Connection, try: await conn.readExactly(addr frameHeader[0], frameHeader.len) except LPStreamEOFError, LPStreamIncompleteError: - break + return err "no snappy frame" let x = uint32.fromBytesLE frameHeader let id = x and 0xFF @@ -118,6 +118,7 @@ proc readChunkPayload(conn: Connection, if data.isOk: return ok SSZ.decode(data.get(), MsgType) else: + debug "Failed getting snappy frame", msg = $data.error, conn = $conn return neterr InvalidSnappyBytes proc readResponseChunk(conn: Connection,