提交 4388e642 编写于 作者: X xywang

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

上级 bb7c70e6
...@@ -663,7 +663,7 @@ static int32_t httpParserOnTarget(HttpParser *parser, HTTP_PARSER_STATE state, c ...@@ -663,7 +663,7 @@ static int32_t httpParserOnTarget(HttpParser *parser, HTTP_PARSER_STATE state, c
HttpContext *pContext = parser->pContext; HttpContext *pContext = parser->pContext;
int32_t ok = 0; int32_t ok = 0;
do { do {
if (!isspace(c) && c != '\r' && c != '\n') { if (!isspace(c)) {
if (httpAppendString(&parser->str, &c, 1)) { if (httpAppendString(&parser->str, &c, 1)) {
httpError("context:%p, fd:%d, parser state:%d, char:[%c]%02x, oom", pContext, pContext->fd, state, c, c); httpError("context:%p, fd:%d, parser state:%d, char:[%c]%02x, oom", pContext, pContext->fd, state, c, c);
ok = -1; ok = -1;
...@@ -1158,7 +1158,7 @@ static int32_t httpParseChar(HttpParser *parser, const char c, int32_t *again) { ...@@ -1158,7 +1158,7 @@ static int32_t httpParseChar(HttpParser *parser, const char c, int32_t *again) {
} }
if (ok != 0) { if (ok != 0) {
pContext->error = 1; pContext->error = true;
} }
return ok; return ok;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册