libei/test
Peter Hutterer daba46a2ae eis: if a client is slow, queue up messages for future delivery
If a receiver client stops calling ei_dispatch for a while eventually
we fill up the send buffer, causing messages to be quietly dropped.
When the client resumes the message stream resumes with whatever we send
next but that can leave the client in an inconsistent state.

deskflow hit this in the server-side where our event sequence of pointer
motion+frames eventually filled up the buffer, causing
eis_device_stop_emulating() to be silently dropped. On the next
InputCapture sequence eis_device_start_emulating() was sent to an
already emulating client (as seen by the client).

This patch adds a secondary queue, if we fail to send a message with
EAGAIN queue it up and flush that queue whenever the next message is
sent. Meanwhile any newly added messages go straight into that queue.

The caveat here: a nonresponding client will eventually trigger OOM,
there is no upper limit on the messages yet

This is the libeis version of
commit 69e973e6b3 ("ei: queue unsent messages for later delivery if our buffer is full")

Closes: #79
Part-of: <https://gitlab.freedesktop.org/libinput/libei/-/merge_requests/331>
2025-05-02 15:40:47 +10:00
..
templates test: drop a bunch of unused imports 2023-02-15 08:20:01 +10:00
buildtest.c Purge libreis from the repo 2023-02-09 11:48:28 +10:00
buildtest.cc test: make the c++ build test mirror the c build test 2024-12-02 00:23:14 +00:00
conftest.py test: run pytest with xdist where available 2023-03-03 11:27:01 +10:00
eierpecken.c ei: add EI_EVENT_SYNC as opaque event to correctly schedule callbacks 2024-12-18 04:30:01 +00:00
eierpecken.h ei: add EI_EVENT_SYNC as opaque event to correctly schedule callbacks 2024-12-18 04:30:01 +00:00
eiproto.py.tmpl test: drop the use of attr 2024-12-10 05:06:49 +00:00
meson.build test: increase protocol-test-valgrind timeout 2025-04-11 15:32:20 +08:00
test-ei-device.c ei: add EI_EVENT_SYNC as opaque event to correctly schedule callbacks 2024-12-18 04:30:01 +00:00
test-ei-seat.c ei: add EI_EVENT_SYNC as opaque event to correctly schedule callbacks 2024-12-18 04:30:01 +00:00
test-ei.c ei: add EI_EVENT_SYNC as opaque event to correctly schedule callbacks 2024-12-18 04:30:01 +00:00
test-eis.c eis: if a client is slow, queue up messages for future delivery 2025-05-02 15:40:47 +10:00
test-main.c Remove empty trailing newlines from all files 2023-03-13 08:52:08 +10:00
test_oeffis.py test: rename a variable to shut up ruff with default args 2024-12-10 05:06:49 +00:00
test_protocol.py test: increase protocol-test-valgrind timeout 2025-04-11 15:32:20 +08:00
test_scanner.py Reformat for ruff 0.9 2025-02-03 13:17:34 +10:00
unit-tests.c Add SPDX identifiers to all source files 2022-03-03 00:27:36 +00:00