From 0a29b75f8e178163d3371b721c79325be9e95f14 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Thu, 22 Jul 2021 17:59:21 +0800 Subject: [PATCH] moninj: fix read of incomplete data (#1729) --- artiq/coredevice/comm_moninj.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/artiq/coredevice/comm_moninj.py b/artiq/coredevice/comm_moninj.py index 08cbcc779..7154ff615 100644 --- a/artiq/coredevice/comm_moninj.py +++ b/artiq/coredevice/comm_moninj.py @@ -74,11 +74,11 @@ class CommMonInj: if not ty: return if ty == b"\x00": - payload = await self._reader.read(9) + payload = await self._reader.readexactly(9) channel, probe, value = struct.unpack(">lbl", payload) self.monitor_cb(channel, probe, value) elif ty == b"\x01": - payload = await self._reader.read(6) + payload = await self._reader.readexactly(6) channel, override, value = struct.unpack(">lbb", payload) self.injection_status_cb(channel, override, value) else: