]> git.kaiwu.me - nginx.git/commitdiff
nginx-0.1.40-RELEASE import release-0.1.40
authorIgor Sysoev <igor@sysoev.ru>
Mon, 25 Jul 2005 09:41:38 +0000 (09:41 +0000)
committerIgor Sysoev <igor@sysoev.ru>
Mon, 25 Jul 2005 09:41:38 +0000 (09:41 +0000)
    *) 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; the bug had 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.

14 files changed:
docs/xml/nginx/changes.xml
src/core/nginx.h
src/http/ngx_http.h
src/http/ngx_http_core_module.c
src/http/ngx_http_request.c
src/http/ngx_http_upstream.c
src/imap/ngx_imap_proxy_module.c
src/os/unix/ngx_freebsd_init.c
src/os/unix/ngx_linux_init.c
src/os/unix/ngx_posix_init.c
src/os/unix/ngx_process.h
src/os/unix/ngx_process_cycle.c
src/os/unix/ngx_setproctitle.c
src/os/unix/ngx_solaris_init.c

index 5bbc85850d34e3d315f87f2c93eb3d9a6db51441..661d9e09177cb29a90b868aea0b5670f4addeb8c 100644 (file)
@@ -9,6 +9,65 @@
 <title lang="en">nginx changelog</title>
 
 
+<changes ver="0.1.40" date="22.07.2005">
+
+<change type="bugfix">
+<para lang="ru">
+ÅÓÌÉ ËÌÉÅÎÔ ÓÌÁÌ ÏÞÅÎØ ÄÌÉÎÎÕÀ ÓÔÒÏËÕ ÚÁÇÏÌÏ×ËÁ, ÔÏ × ÌÏÇÅ ÎÅ ÐÏÍÅÝÁÌÁÓØ
+ÉÎÆÏÒÍÁÃÉÑ, Ó×ÑÚÁÎÎÁÑ Ó ÜÔÉÍ ÚÁÐÒÏÓÏÍ.
+</para>
+<para lang="en">
+if a client sent too long header line, then the request information
+did not logged in the error log.
+</para>
+</change>
+
+<change type="bugfix">
+<para lang="ru">
+ÐÒÉ ÉÓÐÏÌØÚÏ×ÁÎÉÉ "X-Accel-Redirect" ÎÅ ÐÅÒÅÄÁ×ÁÌÁÓØ ÓÔÒÏËÁ "Set-Cookie";
+ÏÛÉÂËÁ ÐÏÑ×ÉÌÁÓØ × 0.1.39.
+</para>
+<para lang="en">
+the "Set-Cookie" header line was not transferred when the "X-Accel-Redirect"
+was used;
+bug appeared in 0.1.39.
+</para>
+</change>
+
+<change type="bugfix">
+<para lang="ru">
+ÐÒÉ ÉÓÐÏÌØÚÏ×ÁÎÉÉ "X-Accel-Redirect" ÎÅ ÐÅÒÅÄÁ×ÁÌÁÓØ ÓÔÒÏËÁ
+"Content-Disposition".
+</para>
+<para lang="en">
+the "Content-Disposition" header line was not transferred when
+the "X-Accel-Redirect" was used.
+</para>
+</change>
+
+<change type="bugfix">
+<para lang="ru">
+ÐÏ ÓÉÇÎÁÌÕ SIGQUIT ÏÓÎÏ×ÎÏÊ ÐÒÏÃÅÓÓ ÎÅ ÚÁËÒÙ×ÁÌ ÓÏËÅÔÙ, ÎÁ ËÏÔÏÒÙÈ ÏΠÓÌÕÛÁÌ.
+</para>
+<para lang="en">
+the master process did not close the listen socket on the SIGQUIT signal.
+</para>
+</change>
+
+<change type="bugfix">
+<para lang="ru">
+ÐÏÓÌÅ ÏÂÎÏ×ÌÅÎÉÑ ÉÓÐÏÌÎÑÅÍÏÇÏ ÆÁÊÌÁ ÎÁ ÌÅÔÕ ÎÁ Linux É Solaris
+ÎÁÚ×ÁÎÉÅ ÐÒÏÃÅÓÓÁ × ËÏÍÁÎÄÅ ps ÓÔÁÎÏ×ÉÌÏÓØ ËÏÒÏÞÅ.
+</para>
+<para lang="en">
+after on-line upgrade on Linux and Solaris the process name
+became shorter in the "ps" command.
+</para>
+</change>
+
+</changes>
+
+
 <changes ver="0.1.39" date="14.07.2005">
 
 <change>
index 4b800e72da8d0a42f51b96441420ea6dc110da17..6f14bdf5314a692a77278b736d4b7b29909ada52 100644 (file)
@@ -8,7 +8,7 @@
 #define _NGINX_H_INCLUDED_
 
 
-#define NGINX_VER          "nginx/0.1.39"
+#define NGINX_VER          "nginx/0.1.40"
 
 #define NGINX_VAR          "NGINX"
 #define NGX_NEWPID_EXT     ".newbin"
index 8af06d2c3ea46d09f8845f695fe795d60d9d6315..2a62896c50d73a9e930f6c6b931080f4b506524c 100644 (file)
@@ -74,8 +74,6 @@ void ngx_http_empty_handler(ngx_event_t *wev);
 void ngx_http_request_empty_handler(ngx_http_request_t *r);
 
 ngx_int_t ngx_http_send_last(ngx_http_request_t *r);
-void ngx_http_close_request(ngx_http_request_t *r, ngx_int_t error);
-void ngx_http_close_connection(ngx_connection_t *c);
 u_char * ngx_http_log_error_info(ngx_http_request_t *r, u_char *buf,
     size_t len);
 
index ad5058512dcd3138134a71403552cea2b1944a4f..cb7c9e8d0cfdb0e64d806dba6f3f6a7663fcf213 100644 (file)
@@ -885,18 +885,6 @@ ngx_http_output_filter(ngx_http_request_t *r, ngx_chain_t *in)
 }
 
 
-ngx_int_t
-ngx_http_redirect(ngx_http_request_t *r, int redirect)
-{
-    /* STUB */
-
-    /* log request */
-
-    ngx_http_close_request(r, 0);
-    return NGX_OK;
-}
-
-
 ngx_int_t
 ngx_http_set_exten(ngx_http_request_t *r)
 {
index f41a891b72e6fa4a2d5367f39dd72f1a0d5ffee3..6c8bf2fa4d47bd5dfd817855cc786e521d094b95 100644 (file)
@@ -43,6 +43,8 @@ static void ngx_http_set_keepalive(ngx_http_request_t *r);
 static void ngx_http_keepalive_handler(ngx_event_t *ev);
 static void ngx_http_set_lingering_close(ngx_http_request_t *r);
 static void ngx_http_lingering_close_handler(ngx_event_t *ev);
+static void ngx_http_close_request(ngx_http_request_t *r, ngx_int_t error);
+static void ngx_http_close_connection(ngx_connection_t *c);
 
 static u_char *ngx_http_log_error(ngx_log_t *log, u_char *buf, size_t len);
 static u_char *ngx_http_log_error_handler(ngx_http_request_t *r, u_char *buf,
@@ -756,6 +758,14 @@ ngx_http_process_request_headers(ngx_event_t *rev)
                 if (rv == NGX_DECLINED) {
                     header.len = r->header_in->end - r->header_name_start;
                     header.data = r->header_name_start;
+
+                    if (header.len > NGX_MAX_ERROR_STR - 300) {
+                        header.len = NGX_MAX_ERROR_STR - 300;
+                        header.data[header.len++] = '.';
+                        header.data[header.len++] = '.';
+                        header.data[header.len++] = '.';
+                    }
+
                     ngx_log_error(NGX_LOG_INFO, c->log, 0,
                                   "client sent too long header line: \"%V\"",
                                   &header);
@@ -2340,8 +2350,7 @@ ngx_http_close_request(ngx_http_request_t *r, ngx_int_t error)
     ngx_log_debug0(NGX_LOG_DEBUG_HTTP, log, 0, "http close request");
 
     if (r->pool == NULL) {
-        ngx_log_error(NGX_LOG_ALERT, log, 0,
-                      "http request already closed");
+        ngx_log_error(NGX_LOG_ALERT, log, 0, "http request already closed");
         return;
     }
 
@@ -2389,8 +2398,8 @@ ngx_http_close_request(ngx_http_request_t *r, ngx_int_t error)
 
 #if (NGX_HTTP_SSL)
 
-void
-ngx_ssl_close_handler(ngx_event_t *ev)
+static void
+ngx_http_ssl_close_handler(ngx_event_t *ev)
 {
     ngx_connection_t  *c;
 
@@ -2408,7 +2417,7 @@ ngx_ssl_close_handler(ngx_event_t *ev)
 #endif
 
 
-void
+static void
 ngx_http_close_connection(ngx_connection_t *c)
 {
     ngx_pool_t  *pool;
@@ -2420,8 +2429,8 @@ ngx_http_close_connection(ngx_connection_t *c)
 
     if (c->ssl) {
         if (ngx_ssl_shutdown(c) == NGX_AGAIN) {
-            c->read->handler = ngx_ssl_close_handler;
-            c->write->handler = ngx_ssl_close_handler;
+            c->read->handler = ngx_http_ssl_close_handler;
+            c->write->handler = ngx_http_ssl_close_handler;
             return;
         }
     }
index 4b877a3fbc4e0d0268531546d52e1c38f944fd6b..f59ff179e2eac74dd83f99563c4c11444009f1ab 100644 (file)
@@ -118,7 +118,11 @@ ngx_http_upstream_header_t  ngx_http_upstream_headers_in[] = {
 
     { ngx_string("Set-Cookie"),
                  ngx_http_upstream_ignore_header_line, 0,
-                 ngx_http_upstream_copy_header_line, 0, 0 },
+                 ngx_http_upstream_copy_header_line, 0, 1 },
+
+    { ngx_string("Content-Disposition"),
+                 ngx_http_upstream_ignore_header_line, 0,
+                 ngx_http_upstream_copy_header_line, 0, 1 },
 
     { ngx_string("Cache-Control"),
                  ngx_http_upstream_process_multi_header_lines,
@@ -221,14 +225,13 @@ ngx_http_upstream_init(ngx_http_request_t *r)
     }
 
     r->read_event_handler = ngx_http_upstream_rd_check_broken_connection;
+    r->write_event_handler = ngx_http_upstream_wr_check_broken_connection;
     
     if (ngx_event_flags & NGX_USE_CLEAR_EVENT) {
-    
-        r->write_event_handler = ngx_http_upstream_wr_check_broken_connection;
 
         if (!c->write->active) {
-            if (ngx_add_event(c->write, NGX_WRITE_EVENT,
-                                                NGX_CLEAR_EVENT) == NGX_ERROR)
+            if (ngx_add_event(c->write, NGX_WRITE_EVENT, NGX_CLEAR_EVENT)
+                == NGX_ERROR)
             {
                 ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
                 return;
index 81ddb83970154f6fb0a27a9ff0e17478e1a02643..be32e6fe26eadec9a030a0c2f0d93c97e37378cf 100644 (file)
@@ -264,6 +264,8 @@ ngx_imap_proxy_imap_handler(ngx_event_t *rev)
         s->connection->write->handler = ngx_imap_proxy_handler;
         rev->handler = ngx_imap_proxy_handler;
         c->write->handler = ngx_imap_proxy_handler;
+
+        ngx_del_timer(c->read);
     }
 }
 
@@ -384,6 +386,8 @@ ngx_imap_proxy_pop3_handler(ngx_event_t *rev)
         s->connection->write->handler = ngx_imap_proxy_handler;
         rev->handler = ngx_imap_proxy_handler;
         c->write->handler = ngx_imap_proxy_handler;
+
+        ngx_del_timer(c->read);
     }
 }
 
index 7defb4676a8b9208248f0f147161298f5e41c741..ab002ae29a28e5d2a7dd6ac65e381c4f5e7d999c 100644 (file)
@@ -232,22 +232,22 @@ void ngx_os_status(ngx_log_t *log)
 {
     ngx_uint_t  i;
 
-    ngx_log_error(NGX_LOG_INFO, log, 0, "OS: %s %s",
+    ngx_log_error(NGX_LOG_NOTICE, log, 0, "OS: %s %s",
                   ngx_freebsd_kern_ostype, ngx_freebsd_kern_osrelease);
 
 #ifdef __DragonFly_version
-    ngx_log_error(NGX_LOG_INFO, log, 0,
+    ngx_log_error(NGX_LOG_NOTICE, log, 0,
                   "kern.osreldate: %d, built on %d",
                   ngx_freebsd_kern_osreldate, __DragonFly_version);
 #else
-    ngx_log_error(NGX_LOG_INFO, log, 0,
+    ngx_log_error(NGX_LOG_NOTICE, log, 0,
                   "kern.osreldate: %d, built on %d",
                   ngx_freebsd_kern_osreldate, __FreeBSD_version);
 #endif
 
     for (i = 0; sysctls[i].name; i++) {
         if (sysctls[i].exists) {
-            ngx_log_error(NGX_LOG_INFO, log, 0, "%s: %d",
+            ngx_log_error(NGX_LOG_NOTICE, log, 0, "%s: %d",
                           sysctls[i].name, *sysctls[i].value);
         }
     }
index 6cb2449fa17c8f410ee7c8c5aec3c3007e9a0d47..56d9f1523f6c4924ebe52bb28769b440e3f605a7 100644 (file)
@@ -81,10 +81,10 @@ ngx_os_init(ngx_log_t *log)
 void
 ngx_os_status(ngx_log_t *log)
 {
-    ngx_log_error(NGX_LOG_INFO, log, 0, "OS: %s %s",
+    ngx_log_error(NGX_LOG_NOTICE, log, 0, "OS: %s %s",
                   ngx_linux_kern_ostype, ngx_linux_kern_osrelease);
 
-    ngx_log_error(NGX_LOG_INFO, log, 0, "sysctl(KERN_RTSIGMAX): %d",
+    ngx_log_error(NGX_LOG_NOTICE, log, 0, "sysctl(KERN_RTSIGMAX): %d",
                   ngx_linux_rtsig_max);
 
 
index a66560acb7393e329b77402b3d214746caaa4ca1..d0de5d5f675fc3a29523a77e7561b71f9e0273bf 100644 (file)
@@ -6,7 +6,6 @@
 
 #include <ngx_config.h>
 #include <ngx_core.h>
-#include <ngx_setproctitle.h>
 
 
 ngx_int_t   ngx_ncpu;
@@ -137,7 +136,7 @@ ngx_int_t ngx_posix_init(ngx_log_t *log)
 
 void ngx_posix_status(ngx_log_t *log)
 {
-    ngx_log_error(NGX_LOG_INFO, log, 0,
+    ngx_log_error(NGX_LOG_NOTICE, log, 0,
                   "getrlimit(RLIMIT_NOFILE): %r:%r",
                   rlmt.rlim_cur, rlmt.rlim_max);
 }
index b85c528d10be1946e3c4b8cfaedaf418a949d90a..25bfa9604e075b5b3e305bd5480cd72ccbfc11b8 100644 (file)
@@ -8,6 +8,9 @@
 #define _NGX_PROCESS_H_INCLUDED_
 
 
+#include <ngx_setproctitle.h>
+
+
 typedef pid_t       ngx_pid_t;
 
 typedef void (*ngx_spawn_proc_pt) (ngx_cycle_t *cycle, void *data);
index d3c92a1b63e827c4e1a3e9b06cf570dac8784a66..9d056941180ecb5f70e2f915ea40cf49bd20f07f 100644 (file)
@@ -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 *cycle)
     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 *cycle)
         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;
         }
 
index 8ae643d9bc6644581c99b648ca298a56028a7401..b814610b76375032e927148e0015b9ec90ceed2d 100644 (file)
@@ -6,7 +6,6 @@
 
 #include <ngx_config.h>
 #include <ngx_core.h>
-#include <ngx_setproctitle.h>
 
 
 #if (NGX_SETPROCTITLE_USES_ENV)
index 9080eb20c1faf23fba70c7dab0dec80618ae1ae7..163adaae95bd45f7bc34acbe8e1032cbdb93f3c8 100644 (file)
@@ -61,10 +61,10 @@ ngx_int_t ngx_os_init(ngx_log_t *log)
 void ngx_os_status(ngx_log_t *log)
 {
 
-    ngx_log_error(NGX_LOG_INFO, log, 0, "OS: %s %s",
+    ngx_log_error(NGX_LOG_NOTICE, log, 0, "OS: %s %s",
                   ngx_solaris_sysname, ngx_solaris_release);
 
-    ngx_log_error(NGX_LOG_INFO, log, 0, "version: %s",
+    ngx_log_error(NGX_LOG_NOTICE, log, 0, "version: %s",
                   ngx_solaris_version);
 
     ngx_posix_status(log);