create empty radix tree for "geo $geo { }" case

This commit is contained in:
Igor Sysoev 2008-11-28 17:22:35 +00:00
parent 80563412b8
commit 8013eba125
1 changed files with 7 additions and 0 deletions

View File

@ -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;