comparison src/core/ngx_cycle.c @ 578:f3a9e57d2e17

Merge with current.
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 11 Mar 2010 21:27:17 +0300
parents 1dcf6adad484
children be4f34123024
comparison
equal deleted inserted replaced
539:5f4de8cf0d9d 578:f3a9e57d2e17
202 if (cycle->hostname.data == NULL) { 202 if (cycle->hostname.data == NULL) {
203 ngx_destroy_pool(pool); 203 ngx_destroy_pool(pool);
204 return NULL; 204 return NULL;
205 } 205 }
206 206
207 ngx_memcpy(cycle->hostname.data, hostname, cycle->hostname.len); 207 ngx_strlow(cycle->hostname.data, (u_char *) hostname, cycle->hostname.len);
208 208
209 209
210 for (i = 0; ngx_modules[i]; i++) { 210 for (i = 0; ngx_modules[i]; i++) {
211 if (ngx_modules[i]->type != NGX_CORE_MODULE) { 211 if (ngx_modules[i]->type != NGX_CORE_MODULE) {
212 continue; 212 continue;
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;