July 07, 2017 07:38AM
details: http://hg.nginx.org/nginx/rev/7f480434c7f2
branches:
changeset: 7053:7f480434c7f2
user: Ruslan Ermilov <ru@nginx.com>
date: Fri Jul 07 14:34:21 2017 +0300
description:
Variables: use ngx_http_variable_null_value where appropriate.

diffstat:

src/http/ngx_http_variables.c | 16 +++++-----------
1 files changed, 5 insertions(+), 11 deletions(-)

diffs (38 lines):

diff -r 70e65bf8dfd7 -r 7f480434c7f2 src/http/ngx_http_variables.c
--- a/src/http/ngx_http_variables.c Tue Jul 04 18:50:41 2017 +0300
+++ b/src/http/ngx_http_variables.c Fri Jul 07 14:34:21 2017 +0300
@@ -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
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;
}
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Variables: use ngx_http_variable_null_value where appropriate.

ru@nginx.com 726 July 07, 2017 07:38AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 266
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready