Welcome! Log In Create A New Profile

Advanced

[nginx] Geo: optimized configuration parser.

February 21, 2018 07:54AM
details: http://hg.nginx.org/nginx/rev/88aad69eccef
branches:
changeset: 7214:88aad69eccef
user: Ruslan Ermilov <ru@nginx.com>
date: Wed Feb 21 15:50:43 2018 +0300
description:
Geo: optimized configuration parser.

If the geo block parser has failed, doing more things is pointless.

diffstat:

src/http/modules/ngx_http_geo_module.c | 6 +++++-
src/stream/ngx_stream_geo_module.c | 6 +++++-
2 files changed, 10 insertions(+), 2 deletions(-)

diffs (46 lines):

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 @@ ngx_http_geo_block(ngx_conf_t *cf, ngx_c

*cf = save;

+ if (rv != NGX_CONF_OK) {
+ goto failed;
+ }
+
geo->proxies = ctx.proxies;
geo->proxy_recursive = ctx.proxy_recursive;

@@ -555,7 +559,7 @@ ngx_http_geo_block(ngx_conf_t *cf, ngx_c
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 @@ ngx_stream_geo_block(ngx_conf_t *cf, ngx

*cf = save;

+ if (rv != NGX_CONF_OK) {
+ goto failed;
+ }
+
if (ctx.ranges) {

if (ctx.high.low && !ctx.binary_include) {
@@ -522,7 +526,7 @@ ngx_stream_geo_block(ngx_conf_t *cf, ngx
ngx_destroy_pool(ctx.temp_pool);
ngx_destroy_pool(pool);

- return rv;
+ return NGX_CONF_OK;

failed:

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Geo: optimized configuration parser.

ru@nginx.com 664 February 21, 2018 07:54AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 208
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready