comparison src/http/modules/ngx_http_geo_module.c @ 2358:ac0cf19eb582

create empty radix tree for "geo $geo { }" case
author Igor Sysoev <igor@sysoev.ru>
date Fri, 28 Nov 2008 17:22:35 +0000
parents 22d2b6609853
children 8522a901df2f
comparison
equal deleted inserted replaced
2357:58c6a9ca7816 2358:ac0cf19eb582
253 if (ctx.high->default_value == NULL) { 253 if (ctx.high->default_value == NULL) {
254 ctx.high->default_value = &ngx_http_variable_null_value; 254 ctx.high->default_value = &ngx_http_variable_null_value;
255 } 255 }
256 256
257 } else { 257 } else {
258 if (ctx.tree == NULL) {
259 ctx.tree = ngx_radix_tree_create(cf->pool, -1);
260 if (ctx.tree == NULL) {
261 return NGX_CONF_ERROR;
262 }
263 }
264
258 var->get_handler = ngx_http_geo_cidr_variable; 265 var->get_handler = ngx_http_geo_cidr_variable;
259 var->data = (uintptr_t) ctx.tree; 266 var->data = (uintptr_t) ctx.tree;
260 267
261 ngx_destroy_pool(ctx.temp_pool); 268 ngx_destroy_pool(ctx.temp_pool);
262 ngx_destroy_pool(pool); 269 ngx_destroy_pool(pool);