test: ignore a ConnectionResetError during our dispatch

If our server disconnects us with data still in the pipe we never picked
up on that data causing heisenbugs depending on whether we read things
(esp. the "disconnected" event) fast enough or not.

Part-of: <https://gitlab.freedesktop.org/libinput/libei/-/merge_requests/317>
This commit is contained in:
Peter Hutterer 2024-12-06 16:08:04 +10:00
parent 7619bfa9ad
commit 96f20ae333

View file

@ -233,7 +233,7 @@ class Ei:
while data:
self._data += data
data = self.sock.recv(1024)
except BlockingIOError:
except (BlockingIOError, ConnectionResetError):
pass
return self.data