comparison src/http/modules/ngx_http_geo_module.c @ 4980:f091722acab4

Geo: ensure that default entry is always present. If 0.0.0.0/32 entry was present and there was no explicit "default", we failed to add an empty string as a default value.
author Ruslan Ermilov <ru@nginx.com>
date Fri, 21 Dec 2012 08:46:52 +0000
parents 76dacc97f23c
children eababa1dc446
comparison
equal deleted inserted replaced
4979:76dacc97f23c 4980:f091722acab4
451 var->data = (uintptr_t) geo; 451 var->data = (uintptr_t) geo;
452 452
453 ngx_destroy_pool(ctx.temp_pool); 453 ngx_destroy_pool(ctx.temp_pool);
454 ngx_destroy_pool(pool); 454 ngx_destroy_pool(pool);
455 455
456 if (ngx_radix32tree_find(ctx.tree, 0) != NGX_RADIX_NO_VALUE) {
457 return rv;
458 }
459
460 if (ngx_radix32tree_insert(ctx.tree, 0, 0, 456 if (ngx_radix32tree_insert(ctx.tree, 0, 0,
461 (uintptr_t) &ngx_http_variable_null_value) 457 (uintptr_t) &ngx_http_variable_null_value)
462 == NGX_ERROR) 458 == NGX_ERROR)
463 { 459 {
464 return NGX_CONF_ERROR; 460 return NGX_CONF_ERROR;
465 } 461 }
462
463 /* NGX_BUSY is okay (default was set explicitly) */
466 } 464 }
467 465
468 return rv; 466 return rv;
469 } 467 }
470 468