comparison src/core/ngx_cycle.c @ 6116:48b3d5ddfb03

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.
author Sergey Kandaurov <pluknet@nginx.com>
date Mon, 20 Apr 2015 16:53:04 +0300
parents 16c51e80128c
children 859ce1c41f64
comparison
equal deleted inserted replaced
6115:61d7ae76647d 6116:48b3d5ddfb03
1205 "already declared for a different use", 1205 "already declared for a different use",
1206 &shm_zone[i].shm.name); 1206 &shm_zone[i].shm.name);
1207 return NULL; 1207 return NULL;
1208 } 1208 }
1209 1209
1210 if (shm_zone[i].shm.size == 0) {
1211 shm_zone[i].shm.size = size;
1212 }
1213
1210 if (size && size != shm_zone[i].shm.size) { 1214 if (size && size != shm_zone[i].shm.size) {
1211 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, 1215 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
1212 "the size %uz of shared memory zone \"%V\" " 1216 "the size %uz of shared memory zone \"%V\" "
1213 "conflicts with already declared size %uz", 1217 "conflicts with already declared size %uz",
1214 size, &shm_zone[i].shm.name, shm_zone[i].shm.size); 1218 size, &shm_zone[i].shm.name, shm_zone[i].shm.size);