diff 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
line wrap: on
line diff
--- a/src/core/ngx_cycle.c
+++ b/src/core/ngx_cycle.c
@@ -336,7 +336,7 @@ ngx_cycle_t *ngx_init_cycle(ngx_cycle_t 
                         }
 
                         nls[n].fd = ls[i].fd;
-                        nls[n].remain = 1;
+                        nls[n].previous = &ls[i];
                         ls[i].remain = 1;
 
                         if (ls[n].backlog != nls[i].backlog) {
@@ -594,7 +594,7 @@ ngx_cycle_t *ngx_init_cycle(ngx_cycle_t 
 
         if (ngx_close_socket(ls[i].fd) == -1) {
             ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno,
-                          ngx_close_socket_n " %V failed",
+                          ngx_close_socket_n " listening socket on %V failed",
                           &ls[i].addr_text);
         }
     }
@@ -627,7 +627,7 @@ ngx_cycle_t *ngx_init_cycle(ngx_cycle_t 
         }
     }
 
-    if (old_cycle->connections == NULL) {
+    if (old_cycle->connections0 == NULL) {
         /* an old cycle is an init cycle */
         ngx_destroy_pool(old_cycle->pool);
         return cycle;
@@ -742,7 +742,8 @@ ngx_int_t ngx_create_pidfile(ngx_cycle_t
     }
 
     ngx_memzero(&file, sizeof(ngx_file_t));
-    file.name = (ngx_inherited && getppid() > 1) ? ccf->newpid : ccf->pid;
+
+    file.name = ccf->pid;
     file.log = cycle->log;
 
     trunc = ngx_test_config ? 0: NGX_FILE_TRUNCATE;
@@ -786,12 +787,7 @@ void ngx_delete_pidfile(ngx_cycle_t *cyc
 
     ccf = (ngx_core_conf_t *) ngx_get_conf(cycle->conf_ctx, ngx_core_module);
 
-    if (ngx_inherited && getppid() > 1) {
-        name = ccf->newpid.data;
-
-    } else { 
-        name = ccf->pid.data;
-    }
+    name = ngx_new_binary ? ccf->oldpid.data : ccf->pid.data;
 
     if (ngx_delete_file(name) == NGX_FILE_ERROR) {
         ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
@@ -963,7 +959,7 @@ static void ngx_clean_old_cycles(ngx_eve
         found = 0;
 
         for (n = 0; n < cycle[i]->connection_n; n++) {
-            if (cycle[i]->connections[n].fd != (ngx_socket_t) -1) {
+            if (cycle[i]->connections0[n].fd != (ngx_socket_t) -1) {
                 found = 1;
 
                 ngx_log_debug1(NGX_LOG_DEBUG_CORE, log, 0, "live fd:%d", n);