diff src/core/ngx_cycle.c @ 6103:79ddb0bdb273

Upstream: the "zone" directive. Upstreams with the "zone" directive are kept in shared memory, with a consistent view of all worker processes.
author Ruslan Ermilov <ru@nginx.com>
date Tue, 14 Apr 2015 19:01:25 +0300
parents 457ec43dd8d5
children 16c51e80128c
line wrap: on
line diff
--- a/src/core/ngx_cycle.c
+++ b/src/core/ngx_cycle.c
@@ -441,7 +441,8 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)
             }
 
             if (shm_zone[i].tag == oshm_zone[n].tag
-                && shm_zone[i].shm.size == oshm_zone[n].shm.size)
+                && shm_zone[i].shm.size == oshm_zone[n].shm.size
+                && !shm_zone[i].noreuse)
             {
                 shm_zone[i].shm.addr = oshm_zone[n].shm.addr;
 
@@ -1234,6 +1235,7 @@ ngx_shared_memory_add(ngx_conf_t *cf, ng
     shm_zone->shm.exists = 0;
     shm_zone->init = NULL;
     shm_zone->tag = tag;
+    shm_zone->noreuse = 0;
 
     return shm_zone;
 }