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

@ -65,7 +65,7 @@ void wl_connection_destroy(struct wl_connection *connection);
void wl_connection_copy(struct wl_connection *connection, void *data, size_t size);
void wl_connection_consume(struct wl_connection *connection, size_t size);
int wl_connection_data(struct wl_connection *connection, uint32_t mask);
void wl_connection_write(struct wl_connection *connection, const void *data, size_t count);
int wl_connection_write(struct wl_connection *connection, const void *data, size_t count);
struct wl_closure *
wl_connection_vmarshal(struct wl_connection *connection,
@ -81,9 +81,9 @@ wl_connection_demarshal(struct wl_connection *connection,
void
wl_closure_invoke(struct wl_closure *closure,
struct wl_object *target, void (*func)(void), void *data);
void
int
wl_closure_send(struct wl_closure *closure, struct wl_connection *connection);
void
int
wl_closure_queue(struct wl_closure *closure, struct wl_connection *connection);
void
wl_closure_print(struct wl_closure *closure, struct wl_object *target, int send);