Mercurial > hg > nginx
comparison src/core/ngx_cycle.c @ 3239:8254055b6693 stable-0.7
merge r2972, r2994, r3133, r3142, r3143, r3174, r3175, r3176:
various perl fixes:
*) fix ngx_http_send_special() for subrequests handled by perl
*) allow perl "sub{..."
*) restore environ, this fixes segfault on reconfiguration failure when
perl module creates new environment
*) optimize error handling
*) use ngx_conf_set_str_array_slot() for perl_require
*) allow several perl_modules
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Mon, 26 Oct 2009 16:22:24 +0000 |
parents | 2efa8d2fcde1 |
children | e1409e56ba7c |
comparison
equal
deleted
inserted
replaced
3238:415400fa0f10 | 3239:8254055b6693 |
---|---|
253 #if 0 | 253 #if 0 |
254 log->log_level = NGX_LOG_DEBUG_ALL; | 254 log->log_level = NGX_LOG_DEBUG_ALL; |
255 #endif | 255 #endif |
256 | 256 |
257 if (ngx_conf_param(&conf) != NGX_CONF_OK) { | 257 if (ngx_conf_param(&conf) != NGX_CONF_OK) { |
258 environ = senv; | |
258 ngx_destroy_cycle_pools(&conf); | 259 ngx_destroy_cycle_pools(&conf); |
259 return NULL; | 260 return NULL; |
260 } | 261 } |
261 | 262 |
262 if (ngx_conf_parse(&conf, &cycle->conf_file) != NGX_CONF_OK) { | 263 if (ngx_conf_parse(&conf, &cycle->conf_file) != NGX_CONF_OK) { |
264 environ = senv; | |
263 ngx_destroy_cycle_pools(&conf); | 265 ngx_destroy_cycle_pools(&conf); |
264 return NULL; | 266 return NULL; |
265 } | 267 } |
266 | 268 |
267 if (ngx_test_config) { | 269 if (ngx_test_config) { |
278 | 280 |
279 if (module->init_conf) { | 281 if (module->init_conf) { |
280 if (module->init_conf(cycle, cycle->conf_ctx[ngx_modules[i]->index]) | 282 if (module->init_conf(cycle, cycle->conf_ctx[ngx_modules[i]->index]) |
281 == NGX_CONF_ERROR) | 283 == NGX_CONF_ERROR) |
282 { | 284 { |
285 environ = senv; | |
283 ngx_destroy_cycle_pools(&conf); | 286 ngx_destroy_cycle_pools(&conf); |
284 return NULL; | 287 return NULL; |
285 } | 288 } |
286 } | 289 } |
287 } | 290 } |
696 ngx_destroy_pool(conf.temp_pool); | 699 ngx_destroy_pool(conf.temp_pool); |
697 | 700 |
698 if (ngx_process == NGX_PROCESS_MASTER || ngx_is_init_cycle(old_cycle)) { | 701 if (ngx_process == NGX_PROCESS_MASTER || ngx_is_init_cycle(old_cycle)) { |
699 | 702 |
700 /* | 703 /* |
701 * perl_destruct() frees environ if it is not the same as it was at | 704 * perl_destruct() frees environ, if it is not the same as it was at |
702 * perl_construct() time. So we have saved an previous cycle | 705 * perl_construct() time, therefore we save the previous cycle |
703 * environment before ngx_conf_parse() where it will be changed. | 706 * environment before ngx_conf_parse() where it will be changed. |
704 */ | 707 */ |
705 | 708 |
706 env = environ; | 709 env = environ; |
707 environ = senv; | 710 environ = senv; |