aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2008-11-28 17:22:35 +0000
committerIgor Sysoev <igor@sysoev.ru>2008-11-28 17:22:35 +0000
commit69b5a6ddfb5226c73b6931fdfc9d0b91ba6bbe5b (patch)
treef3784bab6294b9531f1e588a0be152d73407d837 /src
parent5a214b96e22037abc0f9a498abae4270265ac32f (diff)
downloadnginx-69b5a6ddfb5226c73b6931fdfc9d0b91ba6bbe5b.tar.gz
nginx-69b5a6ddfb5226c73b6931fdfc9d0b91ba6bbe5b.zip
create empty radix tree for "geo $geo { }" case
Diffstat (limited to 'src')
-rw-r--r--src/http/modules/ngx_http_geo_module.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/http/modules/ngx_http_geo_module.c b/src/http/modules/ngx_http_geo_module.c
index 5fc63210c..bba399f6c 100644
--- a/src/http/modules/ngx_http_geo_module.c
+++ b/src/http/modules/ngx_http_geo_module.c
@@ -255,6 +255,13 @@ ngx_http_geo_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
}
} else {
+ if (ctx.tree == NULL) {
+ ctx.tree = ngx_radix_tree_create(cf->pool, -1);
+ if (ctx.tree == NULL) {
+ return NGX_CONF_ERROR;
+ }
+ }
+
var->get_handler = ngx_http_geo_cidr_variable;
var->data = (uintptr_t) ctx.tree;