From 4388e6422cbd92e564d2fd09cc803b04fbba8351 Mon Sep 17 00:00:00 2001 From: xywang Date: Tue, 7 Sep 2021 02:57:16 +0800 Subject: [PATCH] [TD-6217]: optimized parsing function --- src/plugins/http/src/httpParser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/http/src/httpParser.c b/src/plugins/http/src/httpParser.c index 25ba096417..62b1737f6f 100644 --- a/src/plugins/http/src/httpParser.c +++ b/src/plugins/http/src/httpParser.c @@ -663,7 +663,7 @@ static int32_t httpParserOnTarget(HttpParser *parser, HTTP_PARSER_STATE state, c HttpContext *pContext = parser->pContext; int32_t ok = 0; do { - if (!isspace(c) && c != '\r' && c != '\n') { + if (!isspace(c)) { if (httpAppendString(&parser->str, &c, 1)) { httpError("context:%p, fd:%d, parser state:%d, char:[%c]%02x, oom", pContext, pContext->fd, state, c, c); ok = -1; @@ -1158,7 +1158,7 @@ static int32_t httpParseChar(HttpParser *parser, const char c, int32_t *again) { } if (ok != 0) { - pContext->error = 1; + pContext->error = true; } return ok; -- GitLab