From 56ff490ee2e318386a596ab66f42d66c6141cd28 Mon Sep 17 00:00:00 2001 From: Martin Vahlensieck Date: Tue, 8 Oct 2024 13:47:31 +0200 Subject: [PATCH] Raise an EOFException on short reads --- polypheny/rpc.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/polypheny/rpc.py b/polypheny/rpc.py index 7808b257..7753458f 100644 --- a/polypheny/rpc.py +++ b/polypheny/rpc.py @@ -57,6 +57,8 @@ def send_msg(self, serialized): def recv_msg(self): bl = self.con.recv(8) + if len(bl) != 8: + raise EOFError n = int.from_bytes(bl, 'little') raw = self.con.recv(n) if len(raw) != n: