# HG changeset patch # User Ruslan Ermilov # Date 1519217443 -10800 # Node ID 88aad69eccef0422719698b54c82e3a020c0fe93 # Parent c69c13f10502e6429458f3dca576a6a398140892 Geo: optimized configuration parser. If the geo block parser has failed, doing more things is pointless. diff -r c69c13f10502 -r 88aad69eccef src/http/modules/ngx_http_geo_module.c --- a/src/http/modules/ngx_http_geo_module.c Wed Feb 21 15:50:42 2018 +0300 +++ b/src/http/modules/ngx_http_geo_module.c Wed Feb 21 15:50:43 2018 +0300 @@ -461,6 +461,10 @@ *cf = save; + if (rv != NGX_CONF_OK) { + goto failed; + } + geo->proxies = ctx.proxies; geo->proxy_recursive = ctx.proxy_recursive; @@ -555,7 +559,7 @@ ngx_destroy_pool(ctx.temp_pool); ngx_destroy_pool(pool); - return rv; + return NGX_CONF_OK; failed: diff -r c69c13f10502 -r 88aad69eccef src/stream/ngx_stream_geo_module.c --- a/src/stream/ngx_stream_geo_module.c Wed Feb 21 15:50:42 2018 +0300 +++ b/src/stream/ngx_stream_geo_module.c Wed Feb 21 15:50:43 2018 +0300 @@ -431,6 +431,10 @@ *cf = save; + if (rv != NGX_CONF_OK) { + goto failed; + } + if (ctx.ranges) { if (ctx.high.low && !ctx.binary_include) { @@ -522,7 +526,7 @@ ngx_destroy_pool(ctx.temp_pool); ngx_destroy_pool(pool); - return rv; + return NGX_CONF_OK; failed: