# HG changeset patch # User Sergey Kandaurov # Date 1429537984 -10800 # Node ID 48b3d5ddfb031e131491844af507a262bc723d36 # Parent 61d7ae76647d10fadc4399f570e0594308dbd66b Core: allow shared memory size to be declared after a reference. For example, this fixes the case when "proxy_cache_path" is specified after "proxy_cache" that references it. diff --git a/src/core/ngx_cycle.c b/src/core/ngx_cycle.c --- a/src/core/ngx_cycle.c +++ b/src/core/ngx_cycle.c @@ -1207,6 +1207,10 @@ ngx_shared_memory_add(ngx_conf_t *cf, ng return NULL; } + if (shm_zone[i].shm.size == 0) { + shm_zone[i].shm.size = size; + } + if (size && size != shm_zone[i].shm.size) { ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, "the size %uz of shared memory zone \"%V\" "