comparison src/http/ngx_http_variables.c @ 7053:7f480434c7f2

Variables: use ngx_http_variable_null_value where appropriate.
author Ruslan Ermilov <ru@nginx.com>
date Fri, 07 Jul 2017 14:34:21 +0300
parents 1b068a4e82d8
children 2a288909abc6
comparison
equal deleted inserted replaced
7052:70e65bf8dfd7 7053:7f480434c7f2
1461 1461
1462 static ngx_int_t 1462 static ngx_int_t
1463 ngx_http_variable_is_args(ngx_http_request_t *r, 1463 ngx_http_variable_is_args(ngx_http_request_t *r,
1464 ngx_http_variable_value_t *v, uintptr_t data) 1464 ngx_http_variable_value_t *v, uintptr_t data)
1465 { 1465 {
1466 v->valid = 1;
1467 v->no_cacheable = 0;
1468 v->not_found = 0;
1469
1470 if (r->args.len == 0) { 1466 if (r->args.len == 0) {
1471 v->len = 0; 1467 *v = ngx_http_variable_null_value;
1472 v->data = NULL;
1473 return NGX_OK; 1468 return NGX_OK;
1474 } 1469 }
1475 1470
1476 v->len = 1; 1471 v->len = 1;
1472 v->valid = 1;
1473 v->no_cacheable = 0;
1474 v->not_found = 0;
1477 v->data = (u_char *) "?"; 1475 v->data = (u_char *) "?";
1478 1476
1479 return NGX_OK; 1477 return NGX_OK;
1480 } 1478 }
1481 1479
1988 v->data = (u_char *) "OK"; 1986 v->data = (u_char *) "OK";
1989 1987
1990 return NGX_OK; 1988 return NGX_OK;
1991 } 1989 }
1992 1990
1993 v->len = 0; 1991 *v = ngx_http_variable_null_value;
1994 v->valid = 1;
1995 v->no_cacheable = 0;
1996 v->not_found = 0;
1997 v->data = (u_char *) "";
1998 1992
1999 return NGX_OK; 1993 return NGX_OK;
2000 } 1994 }
2001 1995
2002 1996