from nicm: : handle msgbuf_write() returning EAGAIN

This commit is contained in:
benno 2013-11-13 20:43:36 +00:00
parent f0ed61f53c
commit 7624800ddc
2 changed files with 4 additions and 2 deletions

View File

@ -464,7 +464,7 @@ client_callback(unused int fd, short events, void *data)
} }
if (events & EV_WRITE) { if (events & EV_WRITE) {
if (msgbuf_write(&client_ibuf.w) < 0) if (msgbuf_write(&client_ibuf.w) < 0 && errno != EAGAIN)
goto lost_server; goto lost_server;
} }

View File

@ -19,6 +19,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <errno.h>
#include <event.h> #include <event.h>
#include <fcntl.h> #include <fcntl.h>
#include <paths.h> #include <paths.h>
@ -222,7 +223,8 @@ server_client_callback(int fd, short events, void *data)
return; return;
if (fd == c->ibuf.fd) { 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; goto client_lost;
if (c->flags & CLIENT_BAD) { if (c->flags & CLIENT_BAD) {