[nginx] Core: allow shared memory size to be declared after a re...

Sergey Kandaurov pluknet at nginx.com
Mon Apr 20 13:59:41 UTC 2015


details:   http://hg.nginx.org/nginx/rev/48b3d5ddfb03
branches:  
changeset: 6116:48b3d5ddfb03
user:      Sergey Kandaurov <pluknet at nginx.com>
date:      Mon Apr 20 16:53:04 2015 +0300
description:
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:

 src/core/ngx_cycle.c |  4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diffs (14 lines):

diff -r 61d7ae76647d -r 48b3d5ddfb03 src/core/ngx_cycle.c
--- a/src/core/ngx_cycle.c	Mon Apr 20 13:05:11 2015 +0300
+++ b/src/core/ngx_cycle.c	Mon Apr 20 16:53:04 2015 +0300
@@ -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\" "



More information about the nginx-devel mailing list