Don't block when flushing a full protocol buffer

In case the client isn't responding, this will block the compositor.
Instead we flush with MSG_DONTWAIT, which lets us fill up the kernel buffer
as much as we can (after not returning EPOLLOUT anymore it still can take
80k more), and then disconnect the client if we get EAGAIN.
This commit is contained in:
Kristian Høgsberg 2012-02-29 11:07:48 -05:00
parent bf53f2033d
commit b26774da5b
4 changed files with 39 additions and 15 deletions

View file

@ -203,7 +203,10 @@ wl_proxy_marshal(struct wl_proxy *proxy, uint32_t opcode, ...)
abort();
}
wl_closure_send(closure, proxy->display->connection);
if (wl_closure_send(closure, proxy->display->connection)) {
fprintf(stderr, "Error sending request: %m\n");
abort();
}
if (wl_debug)
wl_closure_print(closure, &proxy->object, true);