Mercurial > hg > nginx
comparison src/http/modules/ngx_http_geo_module.c @ 3650:c12b0dd5bd1c
change duplicate default geo range processing
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Tue, 29 Jun 2010 13:36:16 +0000 |
parents | 9f22c780d574 |
children | 1eea82e36053 |
comparison
equal
deleted
inserted
replaced
3649:fd6f0f1a9055 | 3650:c12b0dd5bd1c |
---|---|
486 | 486 |
487 static char * | 487 static char * |
488 ngx_http_geo_range(ngx_conf_t *cf, ngx_http_geo_conf_ctx_t *ctx, | 488 ngx_http_geo_range(ngx_conf_t *cf, ngx_http_geo_conf_ctx_t *ctx, |
489 ngx_str_t *value) | 489 ngx_str_t *value) |
490 { | 490 { |
491 u_char *p, *last; | 491 u_char *p, *last; |
492 in_addr_t start, end; | 492 in_addr_t start, end; |
493 ngx_str_t *net; | 493 ngx_str_t *net; |
494 ngx_uint_t del; | 494 ngx_uint_t del; |
495 ngx_http_variable_value_t *old; | |
496 | 495 |
497 if (ngx_strcmp(value[0].data, "default") == 0) { | 496 if (ngx_strcmp(value[0].data, "default") == 0) { |
498 | 497 |
499 old = ctx->high->default_value; | 498 if (ctx->high->default_value) { |
499 ngx_conf_log_error(NGX_LOG_WARN, cf, 0, | |
500 "duplicate default geo range value: \"%V\", old value: \"%v\"", | |
501 &value[1], ctx->high->default_value); | |
502 } | |
500 | 503 |
501 ctx->high->default_value = ngx_http_geo_value(cf, ctx, &value[1]); | 504 ctx->high->default_value = ngx_http_geo_value(cf, ctx, &value[1]); |
502 if (ctx->high->default_value == NULL) { | 505 if (ctx->high->default_value == NULL) { |
503 return NGX_CONF_ERROR; | 506 return NGX_CONF_ERROR; |
504 } | |
505 | |
506 if (old) { | |
507 ngx_conf_log_error(NGX_LOG_WARN, cf, 0, | |
508 "duplicate range \"%V\", value: \"%v\", old value: \"%v\"", | |
509 &value[0], ctx->high->default_value, old); | |
510 } | 507 } |
511 | 508 |
512 return NGX_CONF_OK; | 509 return NGX_CONF_OK; |
513 } | 510 } |
514 | 511 |