[TD-6217]<enhance>: optimized parsing function
This commit is contained in:
parent
d2aba1bce7
commit
28baf1e536
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue