From 522ec607f824f1928e3e0d0f02bf126117a93cb2 Mon Sep 17 00:00:00 2001 From: Will Date: Sat, 31 Jan 2015 14:33:27 +0900 Subject: [PATCH] pass EOF through to parser --- src/net.c | 2 +- src/wrk.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/net.c b/src/net.c index b4741c79..fb093bba 100644 --- a/src/net.c +++ b/src/net.c @@ -17,7 +17,7 @@ status sock_close(connection *c) { status sock_read(connection *c, size_t *n) { ssize_t r = read(c->fd, c->buf, sizeof(c->buf)); *n = (size_t) r; - return r > 0 ? OK : ERROR; + return r >= 0 ? OK : ERROR; } status sock_write(connection *c, char *buf, size_t len, size_t *n) { diff --git a/src/wrk.c b/src/wrk.c index e64acae9..23da4a8e 100644 --- a/src/wrk.c +++ b/src/wrk.c @@ -458,7 +458,6 @@ static void socket_connected(aeEventLoop *loop, int fd, void *data, int mask) { error: c->thread->errors.connect++; reconnect_socket(c->thread, c); - } static void socket_writeable(aeEventLoop *loop, int fd, void *data, int mask) {