From 7624800ddc8fa8e51164dc7c615894c086deabef Mon Sep 17 00:00:00 2001 From: benno Date: Wed, 13 Nov 2013 20:43:36 +0000 Subject: [PATCH] from nicm: : handle msgbuf_write() returning EAGAIN --- client.c | 2 +- server-client.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/client.c b/client.c index 0f2d3684..82ef9cf0 100644 --- a/client.c +++ b/client.c @@ -464,7 +464,7 @@ client_callback(unused int fd, short events, void *data) } if (events & EV_WRITE) { - if (msgbuf_write(&client_ibuf.w) < 0) + if (msgbuf_write(&client_ibuf.w) < 0 && errno != EAGAIN) goto lost_server; } diff --git a/server-client.c b/server-client.c index 82d840a0..c6257edb 100644 --- a/server-client.c +++ b/server-client.c @@ -19,6 +19,7 @@ #include #include +#include #include #include #include @@ -222,7 +223,8 @@ server_client_callback(int fd, short events, void *data) return; if (fd == c->ibuf.fd) { - if (events & EV_WRITE && msgbuf_write(&c->ibuf.w) < 0) + if (events & EV_WRITE && msgbuf_write(&c->ibuf.w) < 0 && + errno != EAGAIN) goto client_lost; if (c->flags & CLIENT_BAD) {