aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_variables.c
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@nginx.com>2017-07-07 14:34:21 +0300
committerRuslan Ermilov <ru@nginx.com>2017-07-07 14:34:21 +0300
commita54e3193bfa0e0b912cdc394564307be5bb68c17 (patch)
tree1e087502e5f1b1bf5566728faa7c4cd2a5599652 /src/http/ngx_http_variables.c
parent6330817a96bbe2227dd6f2cfeaa785ed27c169a0 (diff)
downloadnginx-a54e3193bfa0e0b912cdc394564307be5bb68c17.tar.gz
nginx-a54e3193bfa0e0b912cdc394564307be5bb68c17.zip
Variables: use ngx_http_variable_null_value where appropriate.
Diffstat (limited to 'src/http/ngx_http_variables.c')
-rw-r--r--src/http/ngx_http_variables.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/http/ngx_http_variables.c b/src/http/ngx_http_variables.c
index cfb538a69..fbc9ffafd 100644
--- a/src/http/ngx_http_variables.c
+++ b/src/http/ngx_http_variables.c
@@ -1463,17 +1463,15 @@ static ngx_int_t
ngx_http_variable_is_args(ngx_http_request_t *r,
ngx_http_variable_value_t *v, uintptr_t data)
{
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
-
if (r->args.len == 0) {
- v->len = 0;
- v->data = NULL;
+ *v = ngx_http_variable_null_value;
return NGX_OK;
}
v->len = 1;
+ v->valid = 1;
+ v->no_cacheable = 0;
+ v->not_found = 0;
v->data = (u_char *) "?";
return NGX_OK;
@@ -1990,11 +1988,7 @@ ngx_http_variable_request_completion(ngx_http_request_t *r,
return NGX_OK;
}
- v->len = 0;
- v->valid = 1;
- v->no_cacheable = 0;
- v->not_found = 0;
- v->data = (u_char *) "";
+ *v = ngx_http_variable_null_value;
return NGX_OK;
}