summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2005-07-25 09:41:38 +0000
committerIgor Sysoev <igor@sysoev.ru>2005-07-25 09:41:38 +0000
commit90c081478175a94a995f8b4341c968c0395161b1 (patch)
tree6fef5fa6d488ed1ba47f0581876d56bf9c16db42
parent9e7984ca78d0a8c39155dd24c8fe0f9a3765a51d (diff)
downloadnginx-90c081478175a94a995f8b4341c968c0395161b1.tar.gz
nginx-0.1.40-RELEASE importrelease-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; 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.
-rw-r--r--docs/xml/nginx/changes.xml59
-rw-r--r--src/core/nginx.h2
-rw-r--r--src/http/ngx_http.h2
-rw-r--r--src/http/ngx_http_core_module.c12
-rw-r--r--src/http/ngx_http_request.c23
-rw-r--r--src/http/ngx_http_upstream.c13
-rw-r--r--src/imap/ngx_imap_proxy_module.c4
-rw-r--r--src/os/unix/ngx_freebsd_init.c8
-rw-r--r--src/os/unix/ngx_linux_init.c4
-rw-r--r--src/os/unix/ngx_posix_init.c3
-rw-r--r--src/os/unix/ngx_process.h3
-rw-r--r--src/os/unix/ngx_process_cycle.c14
-rw-r--r--src/os/unix/ngx_setproctitle.c1
-rw-r--r--src/os/unix/ngx_solaris_init.c4
14 files changed, 113 insertions, 39 deletions
diff --git a/docs/xml/nginx/changes.xml b/docs/xml/nginx/changes.xml
index 5bbc85850..661d9e091 100644
--- a/docs/xml/nginx/changes.xml
+++ b/docs/xml/nginx/changes.xml
@@ -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>
diff --git a/src/core/nginx.h b/src/core/nginx.h
index 4b800e72d..6f14bdf53 100644
--- a/src/core/nginx.h
+++ b/src/core/nginx.h
@@ -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"
diff --git a/src/http/ngx_http.h b/src/http/ngx_http.h
index 8af06d2c3..2a62896c5 100644
--- a/src/http/ngx_http.h
+++ b/src/http/ngx_http.h
@@ -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);
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index ad5058512..cb7c9e8d0 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -886,18 +886,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)
{
ngx_int_t i;
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index f41a891b7..6c8bf2fa4 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -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;
}
}
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
index 4b877a3fb..f59ff179e 100644
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -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;
diff --git a/src/imap/ngx_imap_proxy_module.c b/src/imap/ngx_imap_proxy_module.c
index 81ddb8397..be32e6fe2 100644
--- a/src/imap/ngx_imap_proxy_module.c
+++ b/src/imap/ngx_imap_proxy_module.c
@@ -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);
}
}
diff --git a/src/os/unix/ngx_freebsd_init.c b/src/os/unix/ngx_freebsd_init.c
index 7defb4676..ab002ae29 100644
--- a/src/os/unix/ngx_freebsd_init.c
+++ b/src/os/unix/ngx_freebsd_init.c
@@ -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);
}
}
diff --git a/src/os/unix/ngx_linux_init.c b/src/os/unix/ngx_linux_init.c
index 6cb2449fa..56d9f1523 100644
--- a/src/os/unix/ngx_linux_init.c
+++ b/src/os/unix/ngx_linux_init.c
@@ -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);
diff --git a/src/os/unix/ngx_posix_init.c b/src/os/unix/ngx_posix_init.c
index a66560acb..d0de5d5f6 100644
--- a/src/os/unix/ngx_posix_init.c
+++ b/src/os/unix/ngx_posix_init.c
@@ -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);
}
diff --git a/src/os/unix/ngx_process.h b/src/os/unix/ngx_process.h
index b85c528d1..25bfa9604 100644
--- a/src/os/unix/ngx_process.h
+++ b/src/os/unix/ngx_process.h
@@ -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);
diff --git a/src/os/unix/ngx_process_cycle.c b/src/os/unix/ngx_process_cycle.c
index d3c92a1b6..9d0569411 100644
--- 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 *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;
}
diff --git a/src/os/unix/ngx_setproctitle.c b/src/os/unix/ngx_setproctitle.c
index 8ae643d9b..b814610b7 100644
--- a/src/os/unix/ngx_setproctitle.c
+++ b/src/os/unix/ngx_setproctitle.c
@@ -6,7 +6,6 @@
#include <ngx_config.h>
#include <ngx_core.h>
-#include <ngx_setproctitle.h>
#if (NGX_SETPROCTITLE_USES_ENV)
diff --git a/src/os/unix/ngx_solaris_init.c b/src/os/unix/ngx_solaris_init.c
index 9080eb20c..163adaae9 100644
--- a/src/os/unix/ngx_solaris_init.c
+++ b/src/os/unix/ngx_solaris_init.c
@@ -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);