mirror of
https://github.com/nginx/nginx.git
synced 2025-08-01 11:16:14 +08:00
change duplicate default geo range processing
This commit is contained in:
parent
a81a383053
commit
325bd4ea98
@ -488,27 +488,24 @@ static char *
|
|||||||
ngx_http_geo_range(ngx_conf_t *cf, ngx_http_geo_conf_ctx_t *ctx,
|
ngx_http_geo_range(ngx_conf_t *cf, ngx_http_geo_conf_ctx_t *ctx,
|
||||||
ngx_str_t *value)
|
ngx_str_t *value)
|
||||||
{
|
{
|
||||||
u_char *p, *last;
|
u_char *p, *last;
|
||||||
in_addr_t start, end;
|
in_addr_t start, end;
|
||||||
ngx_str_t *net;
|
ngx_str_t *net;
|
||||||
ngx_uint_t del;
|
ngx_uint_t del;
|
||||||
ngx_http_variable_value_t *old;
|
|
||||||
|
|
||||||
if (ngx_strcmp(value[0].data, "default") == 0) {
|
if (ngx_strcmp(value[0].data, "default") == 0) {
|
||||||
|
|
||||||
old = ctx->high->default_value;
|
if (ctx->high->default_value) {
|
||||||
|
ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
|
||||||
|
"duplicate default geo range value: \"%V\", old value: \"%v\"",
|
||||||
|
&value[1], ctx->high->default_value);
|
||||||
|
}
|
||||||
|
|
||||||
ctx->high->default_value = ngx_http_geo_value(cf, ctx, &value[1]);
|
ctx->high->default_value = ngx_http_geo_value(cf, ctx, &value[1]);
|
||||||
if (ctx->high->default_value == NULL) {
|
if (ctx->high->default_value == NULL) {
|
||||||
return NGX_CONF_ERROR;
|
return NGX_CONF_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (old) {
|
|
||||||
ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
|
|
||||||
"duplicate range \"%V\", value: \"%v\", old value: \"%v\"",
|
|
||||||
&value[0], ctx->high->default_value, old);
|
|
||||||
}
|
|
||||||
|
|
||||||
return NGX_CONF_OK;
|
return NGX_CONF_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user