diff options
Diffstat (limited to 'src/http/modules/ngx_http_limit_zone_module.c')
-rw-r--r-- | src/http/modules/ngx_http_limit_zone_module.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/http/modules/ngx_http_limit_zone_module.c b/src/http/modules/ngx_http_limit_zone_module.c index b32c3da0e..e11e0815b 100644 --- a/src/http/modules/ngx_http_limit_zone_module.c +++ b/src/http/modules/ngx_http_limit_zone_module.c @@ -339,11 +339,19 @@ ngx_http_limit_zone_init_zone(ngx_shm_zone_t *shm_zone, void *data) shpool = (ngx_slab_pool_t *) shm_zone->shm.addr; + if (shm_zone->shm.exists) { + ctx->rbtree = shpool->data; + + return NGX_OK; + } + ctx->rbtree = ngx_slab_alloc(shpool, sizeof(ngx_rbtree_t)); if (ctx->rbtree == NULL) { return NGX_ERROR; } + shpool->data = ctx->rbtree; + sentinel = ngx_slab_alloc(shpool, sizeof(ngx_rbtree_node_t)); if (sentinel == NULL) { return NGX_ERROR; |