aboutsummaryrefslogtreecommitdiff
path: root/src/http/modules/ngx_http_limit_zone_module.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2009-04-18 19:27:28 +0000
committerIgor Sysoev <igor@sysoev.ru>2009-04-18 19:27:28 +0000
commitf7a08d5f9ab224c7d3751693c1ba159a5d6d5900 (patch)
tree09afd5284fde0f9f2b015164f334a81b9a9e00b8 /src/http/modules/ngx_http_limit_zone_module.c
parent6ac68bcc4c3cbc2711fccbc78d6df3164c6dbde3 (diff)
downloadnginx-f7a08d5f9ab224c7d3751693c1ba159a5d6d5900.tar.gz
nginx-f7a08d5f9ab224c7d3751693c1ba159a5d6d5900.zip
support attaching to an existent Win32 shared memory
Diffstat (limited to 'src/http/modules/ngx_http_limit_zone_module.c')
-rw-r--r--src/http/modules/ngx_http_limit_zone_module.c8
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;