comparison src/core/ngx_cycle.c @ 92:45945fa8b8ba NGINX_0_2_0

nginx 0.2.0 *) The pid-file names used during online upgrade was changed and now is not required a manual rename operation. The old master process adds the ".oldbin" suffix to its pid-file and executes a new binary file. The new master process creates usual pid-file without the ".newbin" suffix. If the master process exits, then old master process renames back its pid-file with the ".oldbin" suffix to the pid-file without suffix. *) Change: the "worker_connections" directive, new name of the "connections" directive; now the directive specifies maximum number of connections, but not maximum socket descriptor number. *) Feature: SSL supports the session cache inside one worker process. *) Feature: the "satisfy_any" directive. *) Change: the ngx_http_access_module and ngx_http_auth_basic_module do not run for subrequests. *) Feature: the "worker_rlimit_nofile" and "worker_rlimit_sigpending" directives. *) Bugfix: if all backend using in load-balancing failed after one error, then nginx did not try do connect to them during 60 seconds. *) Bugfix: in IMAP/POP3 command argument parsing. Thanks to Rob Mueller. *) Bugfix: errors while using SSL in IMAP/POP3 proxy. *) Bugfix: errors while using SSI and gzipping. *) Bugfix: the "Expires" and "Cache-Control" header lines were omitted from the 304 responses. Thanks to Alexandr Kukushkin.
author Igor Sysoev <http://sysoev.ru>
date Fri, 23 Sep 2005 00:00:00 +0400
parents 962c43960644
children dad2fe8ecf08
comparison
equal deleted inserted replaced
91:c3eee83ea942 92:45945fa8b8ba
334 failed = 1; 334 failed = 1;
335 break; 335 break;
336 } 336 }
337 337
338 nls[n].fd = ls[i].fd; 338 nls[n].fd = ls[i].fd;
339 nls[n].remain = 1; 339 nls[n].previous = &ls[i];
340 ls[i].remain = 1; 340 ls[i].remain = 1;
341 341
342 if (ls[n].backlog != nls[i].backlog) { 342 if (ls[n].backlog != nls[i].backlog) {
343 nls[n].change_backlog = 1; 343 nls[n].change_backlog = 1;
344 } 344 }
592 continue; 592 continue;
593 } 593 }
594 594
595 if (ngx_close_socket(ls[i].fd) == -1) { 595 if (ngx_close_socket(ls[i].fd) == -1) {
596 ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno, 596 ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno,
597 ngx_close_socket_n " %V failed", 597 ngx_close_socket_n " listening socket on %V failed",
598 &ls[i].addr_text); 598 &ls[i].addr_text);
599 } 599 }
600 } 600 }
601 601
602 602
625 ngx_close_file_n " \"%s\" failed", 625 ngx_close_file_n " \"%s\" failed",
626 file[i].name.data); 626 file[i].name.data);
627 } 627 }
628 } 628 }
629 629
630 if (old_cycle->connections == NULL) { 630 if (old_cycle->connections0 == NULL) {
631 /* an old cycle is an init cycle */ 631 /* an old cycle is an init cycle */
632 ngx_destroy_pool(old_cycle->pool); 632 ngx_destroy_pool(old_cycle->pool);
633 return cycle; 633 return cycle;
634 } 634 }
635 635
740 return NGX_OK; 740 return NGX_OK;
741 } 741 }
742 } 742 }
743 743
744 ngx_memzero(&file, sizeof(ngx_file_t)); 744 ngx_memzero(&file, sizeof(ngx_file_t));
745 file.name = (ngx_inherited && getppid() > 1) ? ccf->newpid : ccf->pid; 745
746 file.name = ccf->pid;
746 file.log = cycle->log; 747 file.log = cycle->log;
747 748
748 trunc = ngx_test_config ? 0: NGX_FILE_TRUNCATE; 749 trunc = ngx_test_config ? 0: NGX_FILE_TRUNCATE;
749 750
750 file.fd = ngx_open_file(file.name.data, NGX_FILE_RDWR, 751 file.fd = ngx_open_file(file.name.data, NGX_FILE_RDWR,
784 return; 785 return;
785 } 786 }
786 787
787 ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module); 788 ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module);
788 789
789 if (ngx_inherited && getppid() > 1) { 790 name = ngx_new_binary ? ccf->oldpid.data : ccf->pid.data;
790 name = ccf->newpid.data;
791
792 } else {
793 name = ccf->pid.data;
794 }
795 791
796 if (ngx_delete_file(name) == NGX_FILE_ERROR) { 792 if (ngx_delete_file(name) == NGX_FILE_ERROR) {
797 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, 793 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
798 ngx_delete_file_n " \"%s\" failed", name); 794 ngx_delete_file_n " \"%s\" failed", name);
799 } 795 }
961 } 957 }
962 958
963 found = 0; 959 found = 0;
964 960
965 for (n = 0; n < cycle[i]->connection_n; n++) { 961 for (n = 0; n < cycle[i]->connection_n; n++) {
966 if (cycle[i]->connections[n].fd != (ngx_socket_t) -1) { 962 if (cycle[i]->connections0[n].fd != (ngx_socket_t) -1) {
967 found = 1; 963 found = 1;
968 964
969 ngx_log_debug1(NGX_LOG_DEBUG_CORE, log, 0, "live fd:%d", n); 965 ngx_log_debug1(NGX_LOG_DEBUG_CORE, log, 0, "live fd:%d", n);
970 966
971 break; 967 break;