From 8bf0b2e3d34a4c0fca3fbd013b675d29794ce0a5 Mon Sep 17 00:00:00 2001 From: Will Date: Wed, 4 Nov 2015 21:40:57 +0900 Subject: [PATCH] handle unexpected EOF as error --- src/wrk.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/wrk.c b/src/wrk.c index b0208b0..b20b14d 100644 --- a/src/wrk.c +++ b/src/wrk.c @@ -432,6 +432,8 @@ static void socket_readable(aeEventLoop *loop, int fd, void *data, int mask) { } if (http_parser_execute(&c->parser, &parser_settings, c->buf, n) != n) goto error; + if (n == 0 && !http_body_is_final(&c->parser)) goto error; + c->thread->bytes += n; } while (n == RECVBUF && sock.readable(c) > 0);