]> git.kaiwu.me - nginx.git/commitdiff
Geo: fixed handling of ranges without default set.
authorMaxim Dounin <mdounin@mdounin.ru>
Thu, 16 Aug 2012 13:01:41 +0000 (13:01 +0000)
committerMaxim Dounin <mdounin@mdounin.ru>
Thu, 16 Aug 2012 13:01:41 +0000 (13:01 +0000)
The bug had appeared in 0.8.43 (r3653).  Patch by Weibin Yao.

src/http/modules/ngx_http_geo_module.c

index 189d8ed508fb726c69a85231c42597e4c72cf500..2308162479d0a348d632559443a060e2824a7918 100644 (file)
@@ -400,15 +400,15 @@ ngx_http_geo_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
             }
         }
 
+        if (ctx.high.default_value == NULL) {
+            ctx.high.default_value = &ngx_http_variable_null_value;
+        }
+
         geo->u.high = ctx.high;
 
         var->get_handler = ngx_http_geo_range_variable;
         var->data = (uintptr_t) geo;
 
-        if (ctx.high.default_value == NULL) {
-            ctx.high.default_value = &ngx_http_variable_null_value;
-        }
-
         ngx_destroy_pool(ctx.temp_pool);
         ngx_destroy_pool(pool);