comparison src/core/ngx_cycle.c @ 484:ed5e10fb40fc NGINX_0_7_54

nginx 0.7.54 *) Feature: the ngx_http_image_filter_module. *) Feature: the "proxy_ignore_headers" and "fastcgi_ignore_headers" directives. *) Bugfix: a segmentation fault might occur in worker process, if an "open_file_cache_errors off" directive was used; the bug had appeared in 0.7.53. *) Bugfix: the "port_in_redirect off" directive did not work; the bug had appeared in 0.7.39. *) Bugfix: improve handling of "select" method errors. *) Bugfix: of "select() failed (10022: ...)" error in nginx/Windows. *) Bugfix: in error text descriptions in nginx/Windows; the bug had appeared in 0.7.53.
author Igor Sysoev <http://sysoev.ru>
date Fri, 01 May 2009 00:00:00 +0400
parents 392c16f2d858
children 6484cbba0222
comparison
equal deleted inserted replaced
483:0a2f4b42ddad 484:ed5e10fb40fc
80 return NULL; 80 return NULL;
81 } 81 }
82 82
83 cycle->pool = pool; 83 cycle->pool = pool;
84 cycle->log = log; 84 cycle->log = log;
85 cycle->new_log.log_level = NGX_LOG_ERR;
85 cycle->old_cycle = old_cycle; 86 cycle->old_cycle = old_cycle;
86 87
87 cycle->conf_prefix.len = old_cycle->conf_prefix.len; 88 cycle->conf_prefix.len = old_cycle->conf_prefix.len;
88 cycle->conf_prefix.data = ngx_pstrdup(pool, &old_cycle->conf_prefix); 89 cycle->conf_prefix.data = ngx_pstrdup(pool, &old_cycle->conf_prefix);
89 if (cycle->conf_prefix.data == NULL) { 90 if (cycle->conf_prefix.data == NULL) {
162 != NGX_OK) 163 != NGX_OK)
163 { 164 {
164 ngx_destroy_pool(pool); 165 ngx_destroy_pool(pool);
165 return NULL; 166 return NULL;
166 } 167 }
167
168
169 cycle->new_log = ngx_log_create_errlog(cycle, &error_log);
170 if (cycle->new_log == NULL) {
171 ngx_destroy_pool(pool);
172 return NULL;
173 }
174
175 168
176 n = old_cycle->listening.nelts ? old_cycle->listening.nelts : 10; 169 n = old_cycle->listening.nelts ? old_cycle->listening.nelts : 10;
177 170
178 cycle->listening.elts = ngx_pcalloc(pool, n * sizeof(ngx_listening_t)); 171 cycle->listening.elts = ngx_pcalloc(pool, n * sizeof(ngx_listening_t));
179 if (cycle->listening.elts == NULL) { 172 if (cycle->listening.elts == NULL) {
334 if (ngx_create_pathes(cycle, ccf->user) != NGX_OK) { 327 if (ngx_create_pathes(cycle, ccf->user) != NGX_OK) {
335 goto failed; 328 goto failed;
336 } 329 }
337 330
338 331
332 if (cycle->new_log.file == NULL) {
333 cycle->new_log.file = ngx_conf_open_file(cycle, &error_log);
334 if (cycle->new_log.file == NULL) {
335 goto failed;
336 }
337 }
338
339 /* open the new files */ 339 /* open the new files */
340 340
341 part = &cycle->open_files.part; 341 part = &cycle->open_files.part;
342 file = part->elts; 342 file = part->elts;
343 343
380 goto failed; 380 goto failed;
381 } 381 }
382 #endif 382 #endif
383 } 383 }
384 384
385 cycle->log = cycle->new_log; 385 cycle->log = &cycle->new_log;
386 pool->log = cycle->new_log; 386 pool->log = &cycle->new_log;
387
388 if (cycle->log->log_level == 0) {
389 cycle->log->log_level = NGX_LOG_ERR;
390 }
391 387
392 388
393 /* create shared memory */ 389 /* create shared memory */
394 390
395 part = &cycle->shared_memory.part; 391 part = &cycle->shared_memory.part;
1124 1120
1125 #if !(NGX_WIN32) 1121 #if !(NGX_WIN32)
1126 if (user != (ngx_uid_t) NGX_CONF_UNSET_UINT) { 1122 if (user != (ngx_uid_t) NGX_CONF_UNSET_UINT) {
1127 ngx_file_info_t fi; 1123 ngx_file_info_t fi;
1128 1124
1129 if (ngx_file_info((const char *) file[i].name.data, &fi) == -1) { 1125 if (ngx_file_info((const char *) file[i].name.data, &fi)
1126 == NGX_FILE_ERROR)
1127 {
1130 ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno, 1128 ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
1131 ngx_file_info_n " \"%s\" failed", 1129 ngx_file_info_n " \"%s\" failed",
1132 file[i].name.data); 1130 file[i].name.data);
1133 1131
1134 if (ngx_close_file(fd) == NGX_FILE_ERROR) { 1132 if (ngx_close_file(fd) == NGX_FILE_ERROR) {