From a1a34cee0351cda5e62cf167d13aaa449cb6a5ec Mon Sep 17 00:00:00 2001 From: Samuel Cabrero Date: Thu, 9 Feb 2023 18:41:10 +0100 Subject: [PATCH] Fix: VarlinkStream not dispatching out data when write returns EAGAIN The connection's fd event mask was updated with EPOLLOUT, but service_connection_set_events_masks() was not called to apply it. Signed-off-by: Samuel Cabrero --- lib/service.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/service.c b/lib/service.c index 0681154..8575979 100644 --- a/lib/service.c +++ b/lib/service.c @@ -658,9 +658,17 @@ _public_ long varlink_call_reply(VarlinkCall *call, return r; /* We did not write all data, wake up when we can write to the socket. */ - if (r == 0) + if (r == 0) { call->connection->events_mask |= EPOLLOUT; + r = service_connection_set_events_mask( + call->service, call->connection, + call->connection->events_mask); + if (r < 0) { + return r; + } + } + if (!(flags & VARLINK_REPLY_CONTINUES)) varlink_call_remove_from_connection(call);