aboutsummaryrefslogtreecommitdiff
path: root/src/core/ngx_cycle.c
diff options
context:
space:
mode:
authorSergey Kandaurov <pluknet@nginx.com>2015-04-20 16:53:04 +0300
committerSergey Kandaurov <pluknet@nginx.com>2015-04-20 16:53:04 +0300
commit06ff11798612f7b9e972885fcfacf0f7b0f172ce (patch)
treebee06ac689d2f636dc7b3d444abeff7b2c09f592 /src/core/ngx_cycle.c
parentc799c82faad507e5f6082669b02f14d332f23a61 (diff)
downloadnginx-06ff11798612f7b9e972885fcfacf0f7b0f172ce.tar.gz
nginx-06ff11798612f7b9e972885fcfacf0f7b0f172ce.zip
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.
Diffstat (limited to 'src/core/ngx_cycle.c')
-rw-r--r--src/core/ngx_cycle.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/ngx_cycle.c b/src/core/ngx_cycle.c
index e9dfdfc2a..eec7da592 100644
--- a/src/core/ngx_cycle.c
+++ b/src/core/ngx_cycle.c
@@ -1207,6 +1207,10 @@ ngx_shared_memory_add(ngx_conf_t *cf, ngx_str_t *name, size_t size, void *tag)
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\" "