Mercurial > hg > nginx
comparison src/http/modules/ngx_http_map_module.c @ 5040:05beaa2d87b3 stable-1.2
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.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Sun, 10 Feb 2013 03:08:42 +0000 |
parents | 43b7b9572fe1 |
children | 5482671df278 |
comparison
equal
deleted
inserted
replaced
5039:b5601d23b61e | 5040:05beaa2d87b3 |
---|---|
207 if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { | 207 if (ngx_http_compile_complex_value(&ccv) != NGX_OK) { |
208 return NGX_CONF_ERROR; | 208 return NGX_CONF_ERROR; |
209 } | 209 } |
210 | 210 |
211 name = value[2]; | 211 name = value[2]; |
212 | |
213 if (name.data[0] != '$') { | |
214 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | |
215 "invalid variable name \"%V\"", &name); | |
216 return NGX_CONF_ERROR; | |
217 } | |
218 | |
212 name.len--; | 219 name.len--; |
213 name.data++; | 220 name.data++; |
214 | 221 |
215 var = ngx_http_add_variable(cf, &name, NGX_HTTP_VAR_CHANGEABLE); | 222 var = ngx_http_add_variable(cf, &name, NGX_HTTP_VAR_CHANGEABLE); |
216 if (var == NULL) { | 223 if (var == NULL) { |