comparison src/core/ngx_cycle.c @ 505:f39b9e29530d NGINX_0_8_0

nginx 0.8.0 *) Feature: the "keepalive_requests" directive. *) Feature: the "limit_rate_after" directive. Thanks to Ivan Debnar. *) Bugfix: XLST filter did not work in subrequests. *) Bugfix: in relative paths handling in nginx/Windows. *) Bugfix: in proxy_store, fastcgi_store, proxy_cache, and fastcgi_cache in nginx/Windows. *) Bugfix: in memory allocation error handling. Thanks to Maxim Dounin and Kirill A. Korinskiy.
author Igor Sysoev <http://sysoev.ru>
date Tue, 02 Jun 2009 00:00:00 +0400
parents 6484cbba0222
children 207ae3ff0444
comparison
equal deleted inserted replaced
504:6d9fb4461113 505:f39b9e29530d
214 214
215 module = ngx_modules[i]->ctx; 215 module = ngx_modules[i]->ctx;
216 216
217 if (module->create_conf) { 217 if (module->create_conf) {
218 rv = module->create_conf(cycle); 218 rv = module->create_conf(cycle);
219 if (rv == NGX_CONF_ERROR) { 219 if (rv == NULL) {
220 ngx_destroy_pool(pool); 220 ngx_destroy_pool(pool);
221 return NULL; 221 return NULL;
222 } 222 }
223 cycle->conf_ctx[ngx_modules[i]->index] = rv; 223 cycle->conf_ctx[ngx_modules[i]->index] = rv;
224 } 224 }
461 461
462 if (ngx_shm_alloc(&shm_zone[i].shm) != NGX_OK) { 462 if (ngx_shm_alloc(&shm_zone[i].shm) != NGX_OK) {
463 goto failed; 463 goto failed;
464 } 464 }
465 465
466 if (!shm_zone[i].shm.exists) { 466 if (ngx_init_zone_pool(cycle, &shm_zone[i]) != NGX_OK) {
467 467 goto failed;
468 if (ngx_init_zone_pool(cycle, &shm_zone[i]) != NGX_OK) {
469 goto failed;
470 }
471 } 468 }
472 469
473 if (shm_zone[i].init(&shm_zone[i], NULL) != NGX_OK) { 470 if (shm_zone[i].init(&shm_zone[i], NULL) != NGX_OK) {
474 goto failed; 471 goto failed;
475 } 472 }
883 u_char *file; 880 u_char *file;
884 ngx_slab_pool_t *sp; 881 ngx_slab_pool_t *sp;
885 882
886 sp = (ngx_slab_pool_t *) zn->shm.addr; 883 sp = (ngx_slab_pool_t *) zn->shm.addr;
887 884
885 if (zn->shm.exists) {
886
887 if (sp == sp->addr) {
888 return NGX_OK;
889 }
890
891 ngx_log_error(NGX_LOG_EMERG, cycle->log, 0,
892 "shared zone \"%V\" has no equal addresses: %p vs %p",
893 &zn->shm.name, sp->addr, sp);
894 return NGX_ERROR;
895 }
896
888 sp->end = zn->shm.addr + zn->shm.size; 897 sp->end = zn->shm.addr + zn->shm.size;
889 sp->min_shift = 3; 898 sp->min_shift = 3;
899 sp->addr = zn->shm.addr;
890 900
891 #if (NGX_HAVE_ATOMIC_OPS) 901 #if (NGX_HAVE_ATOMIC_OPS)
892 902
893 file = NULL; 903 file = NULL;
894 904