Skip to content

Commit

Permalink
Fix: VarlinkStream not dispatching out data when write returns EAGAIN
Browse files Browse the repository at this point in the history
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 <scabrero@suse.de>
  • Loading branch information
scabrero authored and haraldh committed Jun 11, 2024
1 parent e64b93b commit a1a34ce
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/service.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit a1a34ce

Please sign in to comment.