summaryrefslogtreecommitdiffhomepage
path: root/src/test
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2019-09-16 20:17:42 +0300
committerValentin Bartenev <vbart@nginx.com>2019-09-16 20:17:42 +0300
commit2fb7a1bfb90c4c8d484e4b0c4bd5ae2a594fd6e1 (patch)
tree6b81b0c473b18e644a47a452ec9e3d4090b3555f /src/test
parent64be8717bdc2f0f8f11cbb8d18a0f96d2c24c6d3 (diff)
downloadunit-2fb7a1bfb90c4c8d484e4b0c4bd5ae2a594fd6e1.tar.gz
unit-2fb7a1bfb90c4c8d484e4b0c4bd5ae2a594fd6e1.tar.bz2
HTTP parser: removed unused "exten_start" and "args_start" fields.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/nxt_http_parse_test.c24
1 files changed, 8 insertions, 16 deletions
diff --git a/src/test/nxt_http_parse_test.c b/src/test/nxt_http_parse_test.c
index 572e91b2..3e86f6ef 100644
--- a/src/test/nxt_http_parse_test.c
+++ b/src/test/nxt_http_parse_test.c
@@ -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;
}