diff src/os/unix/ngx_process_cycle.c @ 80:6ae11d59d10e NGINX_0_1_40

nginx 0.1.40 *) Bugfix: if a client sent too long header line, then the request information did not logged in the error log. *) Bugfix: the "Set-Cookie" header line was not transferred when the "X-Accel-Redirect" was used; bug appeared in 0.1.39. *) Bugfix: the "Content-Disposition" header line was not transferred when the "X-Accel-Redirect" was used. *) Bugfix: the master process did not close the listen socket on the SIGQUIT signal. *) Bugfix: after on-line upgrade on Linux and Solaris the process name became shorter in the "ps" command.
author Igor Sysoev <http://sysoev.ru>
date Fri, 22 Jul 2005 00:00:00 +0400
parents b31656313b59
children 991c6e4c7654
line wrap: on
line diff
--- a/src/os/unix/ngx_process_cycle.c
+++ b/src/os/unix/ngx_process_cycle.c
@@ -7,7 +7,6 @@
 #include <ngx_config.h>
 #include <ngx_core.h>
 #include <ngx_event.h>
-#include <ngx_setproctitle.h>
 #include <ngx_channel.h>
 
 
@@ -69,11 +68,13 @@ ngx_master_process_cycle(ngx_cycle_t *cy
     u_char            *p;
     size_t             size;
     ngx_int_t          i;
+    ngx_uint_t         n;
     sigset_t           set;
     struct timeval     tv;
     struct itimerval   itv;
     ngx_uint_t         live;
     ngx_msec_t         delay;
+    ngx_listening_t   *ls;
     ngx_core_conf_t   *ccf;
 
     sigemptyset(&set);
@@ -179,6 +180,17 @@ ngx_master_process_cycle(ngx_cycle_t *cy
         if (ngx_quit) {
             ngx_signal_worker_processes(cycle,
                                         ngx_signal_value(NGX_SHUTDOWN_SIGNAL));
+
+            ls = cycle->listening.elts;
+            for (n = 0; n < cycle->listening.nelts; n++) {
+                if (ngx_close_socket(ls[n].fd) == -1) {
+                    ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_socket_errno,
+                                  ngx_close_socket_n " %V failed",
+                                  &ls[n].addr_text);
+                }
+            }
+            cycle->listening.nelts = 0;
+
             continue;
         }