From 8967b7e032aad31ceb6b6fba9ae71f5eb3c16010 Mon Sep 17 00:00:00 2001 From: Maxim Dounin Date: Sun, 10 Feb 2013 03:08:42 +0000 Subject: Merge of r4948, r4949, r4964, r4973, r5011: variables. *) Allow the complex value to be defined as an empty string. This makes conversion from strings to complex values possible without the loss of functionality. *) The "auth_basic" directive gained support of variables. *) Fixed variable syntax checking in "set", "geo", "limit_conn_zone", and "perl_set" directives. *) Added checks that disallow adding a variable with an empty name. Added variable name syntax checks to "geo" and "map" directives. *) Variables $pipe, $request_length, $time_iso8601, and $time_local. Log module counterparts are preserved for efficiency. Based on patch by Kiril Kalchev. --- src/http/ngx_http_script.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src/http/ngx_http_script.c') diff --git a/src/http/ngx_http_script.c b/src/http/ngx_http_script.c index e214519fc..54d019589 100644 --- a/src/http/ngx_http_script.c +++ b/src/http/ngx_http_script.c @@ -114,11 +114,6 @@ ngx_http_compile_complex_value(ngx_http_compile_complex_value_t *ccv) v = ccv->value; - if (v->len == 0) { - ngx_conf_log_error(NGX_LOG_EMERG, ccv->cf, 0, "empty parameter"); - return NGX_ERROR; - } - nv = 0; nc = 0; @@ -133,8 +128,9 @@ ngx_http_compile_complex_value(ngx_http_compile_complex_value_t *ccv) } } - if (v->data[0] != '$' && (ccv->conf_prefix || ccv->root_prefix)) { - + if ((v->len == 0 || v->data[0] != '$') + && (ccv->conf_prefix || ccv->root_prefix)) + { if (ngx_conf_full_name(ccv->cf->cycle, v, ccv->conf_prefix) != NGX_OK) { return NGX_ERROR; } -- cgit