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) {