diff --git a/yaqd-core/CHANGELOG.md b/yaqd-core/CHANGELOG.md index 0eb919b..8f94041 100644 --- a/yaqd-core/CHANGELOG.md +++ b/yaqd-core/CHANGELOG.md @@ -6,6 +6,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/). ## [Unreleased] ### Fixed +- daemon servers no longer keep all recieved messages in memory - removed asyncio syntax that was removed in python 3.14 - type hints for IsSensor attributes are appropriate for _n_-dimensional data diff --git a/yaqd-core/yaqd_core/avrorpc/unpacker.py b/yaqd-core/yaqd_core/avrorpc/unpacker.py index 1d507f7..35e4413 100644 --- a/yaqd-core/yaqd_core/avrorpc/unpacker.py +++ b/yaqd-core/yaqd_core/avrorpc/unpacker.py @@ -71,6 +71,11 @@ def feed(self, data: bytes): # Must support random access, if it does not, must be fed externally (e.g. TCP) pos = self._file.tell() self._file.seek(0, 2) + if pos == self._file.tell(): + # read reached EOF and we are safe to clear + self._file.seek(0) + self._file.truncate(0) + pos = 0 self._file.write(data) self._file.seek(pos) self.new_data.set()