HTTP parser: removed unused "exten_start" and "args_start" fields.

This commit is contained in:
Valentin Bartenev
2019-09-16 20:17:42 +03:00
parent 64be8717bd
commit 2fb7a1bfb9
3 changed files with 37 additions and 47 deletions

View File

@@ -80,7 +80,7 @@ static nxt_http_parse_test_case_t nxt_http_test_cases[] = {
{ .request_line = {
nxt_string("XXX-METHOD"),
nxt_string("/d.ir/fi+le.ext?key=val"),
nxt_string("ext?key=val"),
nxt_string("ext"),
nxt_string("key=val"),
"HTTP/1.2",
0, 0, 0, 1
@@ -163,7 +163,7 @@ static nxt_http_parse_test_case_t nxt_http_test_cases[] = {
nxt_string("GET"),
nxt_string("/?#"),
nxt_null_string,
nxt_string("#"),
nxt_string(""),
"HTTP/1.0",
1, 0, 0, 0
}}
@@ -729,31 +729,23 @@ nxt_http_parse_test_request_line(nxt_http_request_parse_t *rp,
return NXT_ERROR;
}
str.length = (rp->exten_start != NULL) ? rp->target_end - rp->exten_start
: 0;
str.start = rp->exten_start;
if (str.start != test->exten.start
&& !nxt_strstr_eq(&str, &test->exten))
if (rp->exten.start != test->exten.start
&& !nxt_strstr_eq(&rp->exten, &test->exten))
{
nxt_log_alert(log, "http parse test case failed:\n"
" - request:\n\"%V\"\n"
" - exten: \"%V\" (expected: \"%V\")",
request, &str, &test->exten);
request, &rp->exten, &test->exten);
return NXT_ERROR;
}
str.length = (rp->args_start != NULL) ? rp->target_end - rp->args_start
: 0;
str.start = rp->args_start;
if (str.start != test->args.start
&& !nxt_strstr_eq(&str, &test->args))
if (rp->args.start != test->args.start
&& !nxt_strstr_eq(&rp->args, &test->args))
{
nxt_log_alert(log, "http parse test case failed:\n"
" - request:\n\"%V\"\n"
" - args: \"%V\" (expected: \"%V\")",
request, &str, &test->args);
request, &rp->args, &test->args);
return NXT_ERROR;
}