comparison src/os/unix/ngx_process_cycle.c @ 6379:cf5e822cf470

Dynamic modules: changed ngx_modules to cycle->modules.
author Maxim Dounin <mdounin@mdounin.ru>
date Thu, 04 Feb 2016 18:30:21 +0300
parents 5e6142609e48
children 7296b38f6416
comparison
equal deleted inserted replaced
6378:0f203a2af17c 6379:cf5e822cf470
292 if (ngx_set_environment(cycle, NULL) == NULL) { 292 if (ngx_set_environment(cycle, NULL) == NULL) {
293 /* fatal */ 293 /* fatal */
294 exit(2); 294 exit(2);
295 } 295 }
296 296
297 for (i = 0; ngx_modules[i]; i++) { 297 for (i = 0; cycle->modules[i]; i++) {
298 if (ngx_modules[i]->init_process) { 298 if (cycle->modules[i]->init_process) {
299 if (ngx_modules[i]->init_process(cycle) == NGX_ERROR) { 299 if (cycle->modules[i]->init_process(cycle) == NGX_ERROR) {
300 /* fatal */ 300 /* fatal */
301 exit(2); 301 exit(2);
302 } 302 }
303 } 303 }
304 } 304 }
308 308
309 ngx_process_events_and_timers(cycle); 309 ngx_process_events_and_timers(cycle);
310 310
311 if (ngx_terminate || ngx_quit) { 311 if (ngx_terminate || ngx_quit) {
312 312
313 for (i = 0; ngx_modules[i]; i++) { 313 for (i = 0; cycle->modules[i]; i++) {
314 if (ngx_modules[i]->exit_process) { 314 if (cycle->modules[i]->exit_process) {
315 ngx_modules[i]->exit_process(cycle); 315 cycle->modules[i]->exit_process(cycle);
316 } 316 }
317 } 317 }
318 318
319 ngx_master_process_exit(cycle); 319 ngx_master_process_exit(cycle);
320 } 320 }
687 687
688 ngx_delete_pidfile(cycle); 688 ngx_delete_pidfile(cycle);
689 689
690 ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "exit"); 690 ngx_log_error(NGX_LOG_NOTICE, cycle->log, 0, "exit");
691 691
692 for (i = 0; ngx_modules[i]; i++) { 692 for (i = 0; cycle->modules[i]; i++) {
693 if (ngx_modules[i]->exit_master) { 693 if (cycle->modules[i]->exit_master) {
694 ngx_modules[i]->exit_master(cycle); 694 cycle->modules[i]->exit_master(cycle);
695 } 695 }
696 } 696 }
697 697
698 ngx_close_listening_sockets(cycle); 698 ngx_close_listening_sockets(cycle);
699 699
893 ls = cycle->listening.elts; 893 ls = cycle->listening.elts;
894 for (i = 0; i < cycle->listening.nelts; i++) { 894 for (i = 0; i < cycle->listening.nelts; i++) {
895 ls[i].previous = NULL; 895 ls[i].previous = NULL;
896 } 896 }
897 897
898 for (i = 0; ngx_modules[i]; i++) { 898 for (i = 0; cycle->modules[i]; i++) {
899 if (ngx_modules[i]->init_process) { 899 if (cycle->modules[i]->init_process) {
900 if (ngx_modules[i]->init_process(cycle) == NGX_ERROR) { 900 if (cycle->modules[i]->init_process(cycle) == NGX_ERROR) {
901 /* fatal */ 901 /* fatal */
902 exit(2); 902 exit(2);
903 } 903 }
904 } 904 }
905 } 905 }
947 ngx_worker_process_exit(ngx_cycle_t *cycle) 947 ngx_worker_process_exit(ngx_cycle_t *cycle)
948 { 948 {
949 ngx_uint_t i; 949 ngx_uint_t i;
950 ngx_connection_t *c; 950 ngx_connection_t *c;
951 951
952 for (i = 0; ngx_modules[i]; i++) { 952 for (i = 0; cycle->modules[i]; i++) {
953 if (ngx_modules[i]->exit_process) { 953 if (cycle->modules[i]->exit_process) {
954 ngx_modules[i]->exit_process(cycle); 954 cycle->modules[i]->exit_process(cycle);
955 } 955 }
956 } 956 }
957 957
958 if (ngx_exiting) { 958 if (ngx_exiting) {
959 c = cycle->connections; 959 c = cycle->connections;