summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2005-07-22 13:22:07 +0000
committerJonathan Kolb <jon@b0g.us>2005-07-22 13:22:07 +0000
commitbab33f21628a9071931be571983c6c178a8be95a (patch)
tree982aca951064908d3eb60e125b87197e61d747bd
parentdc01b38f28585575807f780b9c147729cf93000a (diff)
downloadnginx-bab33f21628a9071931be571983c6c178a8be95a.tar.gz
Changes with nginx 0.1.40 22 Jul 2005v0.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.
-rw-r--r--CHANGES18
-rw-r--r--CHANGES.ru18
-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
15 files changed, 90 insertions, 39 deletions
diff --git a/CHANGES b/CHANGES
index a06ba7931..45c5da1fe 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,22 @@
+Changes with nginx 0.1.40 22 Jul 2005
+
+ *) 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.
+
+
Changes with nginx 0.1.39 14 Jul 2005
*) The changes in the ngx_http_charset_module: the "default_charset"
diff --git a/CHANGES.ru b/CHANGES.ru
index 1b6e4d3a0..4a67384bc 100644
--- a/CHANGES.ru
+++ b/CHANGES.ru
@@ -1,4 +1,22 @@
+Изменения в nginx 0.1.40 22.07.2005
+
+ *) Исправление: если клиент слал очень длинную строку заголовка, то в
+ логе не помещалась информация, связанная с этим запросом.
+
+ *) Исправление: при использовании "X-Accel-Redirect" не передавалась
+ строка "Set-Cookie"; ошибка появилась в 0.1.39.
+
+ *) Исправление: при использовании "X-Accel-Redirect" не передавалась
+ строка "Content-Disposition".
+
+ *) Исправление: по сигналу SIGQUIT основной процесс не закрывал сокеты,
+ на которых он слушал.
+
+ *) Исправление: после обновления исполняемого файла на лету на Linux и
+ Solaris название процесса в команде ps становилось короче.
+
+
Изменения в nginx 0.1.39 14.07.2005
*) Изменения в модуле ngx_http_charset_module: директива
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);