提交 28baf1e5 编写于 作者: X xywang

[TD-6217]<enhance>: optimized parsing function

上级 d2aba1bc
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册