From 2b67907176805e3df5bd913174617d768277bfff Mon Sep 17 00:00:00 2001 From: krw Date: Sun, 13 Jul 2014 20:51:08 +0000 Subject: [PATCH] An EOF is a good reason to close a connection. ok nicm@ --- client.c | 2 +- server-client.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client.c b/client.c index ec63fc07..ab7847fe 100644 --- a/client.c +++ b/client.c @@ -469,7 +469,7 @@ client_callback(unused int fd, short events, void *data) } if (events & EV_WRITE) { - if (msgbuf_write(&client_ibuf.w) < 0 && errno != EAGAIN) + if (msgbuf_write(&client_ibuf.w) <= 0 && errno != EAGAIN) goto lost_server; } diff --git a/server-client.c b/server-client.c index 1ef3f311..5616115c 100644 --- a/server-client.c +++ b/server-client.c @@ -224,7 +224,7 @@ 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;