summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_http_variables.c
diff options
context:
space:
mode:
authorKonstantin Pavlov <thresh@nginx.com>2023-05-10 10:29:16 -0700
committerKonstantin Pavlov <thresh@nginx.com>2023-05-10 10:29:16 -0700
commit69235c513277c64b513447d9b92c3c03d616f577 (patch)
tree0780c92ba28d92b547c85ea0bee5e3040e14dee2 /src/nxt_http_variables.c
parentb9bc222021e77bbdfb12576b3e315b962cf6b399 (diff)
parentfaf97dc06058de1c929af33a68adb34d3932b374 (diff)
downloadunit-1.30.0-1.tar.gz
unit-1.30.0-1.tar.bz2
Merged with the default branch.1.30.0-1
Diffstat (limited to '')
-rw-r--r--src/nxt_http_variables.c31
1 files changed, 1 insertions, 30 deletions
diff --git a/src/nxt_http_variables.c b/src/nxt_http_variables.c
index fa0244db..b73d9151 100644
--- a/src/nxt_http_variables.c
+++ b/src/nxt_http_variables.c
@@ -273,40 +273,11 @@ static nxt_int_t
nxt_http_var_request_line(nxt_task_t *task, nxt_str_t *str, void *ctx,
uint16_t field)
{
- size_t length;
- u_char *p, *start;
nxt_http_request_t *r;
r = ctx;
- length = r->method->length + 1 + r->target.length + 1 + r->version.length;
-
- start = nxt_mp_nget(r->mem_pool, length);
- if (nxt_slow_path(start == NULL)) {
- return NXT_ERROR;
- }
-
- p = start;
-
- if (r->method->length != 0) {
- p = nxt_cpymem(p, r->method->start, r->method->length);
-
- if (r->target.length != 0) {
- *p++ = ' ';
- p = nxt_cpymem(p, r->target.start, r->target.length);
-
- if (r->version.length != 0) {
- *p++ = ' ';
- p = nxt_cpymem(p, r->version.start, r->version.length);
- }
- }
-
- } else {
- *p++ = '-';
- }
-
- str->start = start;
- str->length = p - start;
+ *str = r->request_line;
return NXT_OK;
}