Mercurial > hg > nginx
comparison src/http/modules/ngx_http_geo_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 | 880dedfa4008 |
children | 852f40088278 |
comparison
equal
deleted
inserted
replaced
5039:b5601d23b61e | 5040:05beaa2d87b3 |
---|---|
320 if (geo == NULL) { | 320 if (geo == NULL) { |
321 return NGX_CONF_ERROR; | 321 return NGX_CONF_ERROR; |
322 } | 322 } |
323 | 323 |
324 name = value[1]; | 324 name = value[1]; |
325 | |
326 if (name.data[0] != '$') { | |
327 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | |
328 "invalid variable name \"%V\"", &name); | |
329 return NGX_CONF_ERROR; | |
330 } | |
331 | |
325 name.len--; | 332 name.len--; |
326 name.data++; | 333 name.data++; |
327 | 334 |
328 if (cf->args->nelts == 3) { | 335 if (cf->args->nelts == 3) { |
329 | 336 |
331 if (geo->index == NGX_ERROR) { | 338 if (geo->index == NGX_ERROR) { |
332 return NGX_CONF_ERROR; | 339 return NGX_CONF_ERROR; |
333 } | 340 } |
334 | 341 |
335 name = value[2]; | 342 name = value[2]; |
343 | |
344 if (name.data[0] != '$') { | |
345 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, | |
346 "invalid variable name \"%V\"", &name); | |
347 return NGX_CONF_ERROR; | |
348 } | |
349 | |
336 name.len--; | 350 name.len--; |
337 name.data++; | 351 name.data++; |
338 | 352 |
339 } else { | 353 } else { |
340 geo->index = -1; | 354 geo->index = -1; |