summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2009-09-07 08:25:51 +0000
committerJonathan Kolb <jon@b0g.us>2009-09-07 08:25:51 +0000
commit7b3d98fb1cf253877bc0deeafecd1feeb2b8fd22 (patch)
tree06760992b1f9fb07d82707546554dc72adae813f
parent2c14b77a0a349044ea4999dd4663314a886cf799 (diff)
downloadnginx-7b3d98fb1cf253877bc0deeafecd1feeb2b8fd22.tar.gz
Changes with nginx 0.8.14 07 Sep 2009v0.8.14
*) Bugfix: an expired cached response might stick in the "UPDATING" state. *) Bugfix: a segmentation fault might occur in worker process, if error_log was set to info or debug level. Thanks to Sergey Bochenkov. *) Bugfix: in embedded perl module; the bug had appeared in 0.8.11. *) Bugfix: an "error_page" directive did not redirect a 413 error; the bug had appeared in 0.6.10.
-rw-r--r--CHANGES17
-rw-r--r--CHANGES.ru16
-rw-r--r--src/core/nginx.h4
-rw-r--r--src/http/modules/perl/nginx.pm2
-rw-r--r--src/http/modules/perl/ngx_http_perl_module.c8
-rw-r--r--src/http/ngx_http_copy_filter_module.c2
-rw-r--r--src/http/ngx_http_core_module.c1
-rw-r--r--src/http/ngx_http_parse.c2
-rw-r--r--src/http/ngx_http_request.c36
-rw-r--r--src/http/ngx_http_request.h2
-rw-r--r--src/http/ngx_http_request_body.c1
-rw-r--r--src/http/ngx_http_upstream.c4
-rw-r--r--src/os/unix/ngx_freebsd_sendfile_chain.c7
13 files changed, 68 insertions, 34 deletions
diff --git a/CHANGES b/CHANGES
index 6c2c7bb1f..5a1d3a713 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,7 +1,22 @@
+Changes with nginx 0.8.14 07 Sep 2009
+
+ *) Bugfix: an expired cached response might stick in the "UPDATING"
+ state.
+
+ *) Bugfix: a segmentation fault might occur in worker process, if
+ error_log was set to info or debug level.
+ Thanks to Sergey Bochenkov.
+
+ *) Bugfix: in embedded perl module; the bug had appeared in 0.8.11.
+
+ *) Bugfix: an "error_page" directive did not redirect a 413 error; the
+ bug had appeared in 0.6.10.
+
+
Changes with nginx 0.8.13 31 Aug 2009
- *) Bugfix: in the "aio sendfile" directive. the bug had appeared in
+ *) Bugfix: in the "aio sendfile" directive; the bug had appeared in
0.8.12.
*) Bugfix: nginx could not be built without the --with-file-aio option
diff --git a/CHANGES.ru b/CHANGES.ru
index 0fff12db3..37223ce43 100644
--- a/CHANGES.ru
+++ b/CHANGES.ru
@@ -1,4 +1,20 @@
+Изменения в nginx 0.8.14 07.09.2009
+
+ *) Исправление: устаревший закэшированный запрос мог залипнуть в
+ состоянии "UPDATING".
+
+ *) Исправление: при использовании error_log на уровне info или debug в
+ рабочем процессе мог произойти segmentation fault.
+ Спасибо Сергею Боченкову.
+
+ *) Исправление: ошибки при использовании встроенного перла; ошибка
+ появилась в 0.8.11.
+
+ *) Исправление: директива error_page не перенаправляла ошибку 413;
+ ошибка появилась в 0.6.10.
+
+
Изменения в nginx 0.8.13 31.08.2009
*) Исправление: в директиве "aio sendfile"; ошибка появилась в 0.8.12.
diff --git a/src/core/nginx.h b/src/core/nginx.h
index c5ab14578..65434e534 100644
--- a/src/core/nginx.h
+++ b/src/core/nginx.h
@@ -8,8 +8,8 @@
#define _NGINX_H_INCLUDED_
-#define nginx_version 8013
-#define NGINX_VERSION "0.8.13"
+#define nginx_version 8014
+#define NGINX_VERSION "0.8.14"
#define NGINX_VER "nginx/" NGINX_VERSION
#define NGINX_VAR "NGINX"
diff --git a/src/http/modules/perl/nginx.pm b/src/http/modules/perl/nginx.pm
index 4b5325361..b6a68d413 100644
--- a/src/http/modules/perl/nginx.pm
+++ b/src/http/modules/perl/nginx.pm
@@ -47,7 +47,7 @@ our @EXPORT = qw(
HTTP_INSUFFICIENT_STORAGE
);
-our $VERSION = '0.8.13';
+our $VERSION = '0.8.14';
require XSLoader;
XSLoader::load('nginx', $VERSION);
diff --git a/src/http/modules/perl/ngx_http_perl_module.c b/src/http/modules/perl/ngx_http_perl_module.c
index c4f52a58f..34ecc9a33 100644
--- a/src/http/modules/perl/ngx_http_perl_module.c
+++ b/src/http/modules/perl/ngx_http_perl_module.c
@@ -179,6 +179,8 @@ ngx_http_perl_handler(ngx_http_request_t *r)
return NGX_HTTP_NOT_FOUND;
}
+ r->main->count++;
+
ngx_http_perl_handle_request(r);
return NGX_DONE;
@@ -232,6 +234,9 @@ ngx_http_perl_handle_request(ngx_http_request_t *r)
}
+ ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
+ "perl handler done: %i", rc);
+
if (rc == NGX_DONE) {
return;
}
@@ -240,9 +245,6 @@ ngx_http_perl_handle_request(ngx_http_request_t *r)
rc = NGX_OK;
}
- ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
- "perl handler done: %i", rc);
-
if (ctx->redirect_uri.len) {
uri = ctx->redirect_uri;
args = ctx->redirect_args;
diff --git a/src/http/ngx_http_copy_filter_module.c b/src/http/ngx_http_copy_filter_module.c
index 954717d8b..713f44023 100644
--- a/src/http/ngx_http_copy_filter_module.c
+++ b/src/http/ngx_http_copy_filter_module.c
@@ -171,7 +171,7 @@ ngx_http_copy_filter(ngx_http_request_t *r, ngx_chain_t *in)
c->busy_sendfile = NULL;
e = (ngx_http_ephemeral_t *) &r->uri_start;
- n = ngx_file_aio_read(file, e->preload, 4, offset, r->pool);
+ n = ngx_file_aio_read(file, &e->aio_preload, 1, offset, r->pool);
if (n > 0) {
continue;
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index 8d83c440e..f99b91031 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -917,6 +917,7 @@ ngx_http_core_find_config_phase(ngx_http_request_t *r,
"client intended to send too large body: %O bytes",
r->headers_in.content_length_n);
+ (void) ngx_http_discard_request_body(r);
ngx_http_finalize_request(r, NGX_HTTP_REQUEST_ENTITY_TOO_LARGE);
return NGX_OK;
}
diff --git a/src/http/ngx_http_parse.c b/src/http/ngx_http_parse.c
index fd48fcdff..9865564e5 100644
--- a/src/http/ngx_http_parse.c
+++ b/src/http/ngx_http_parse.c
@@ -739,6 +739,7 @@ ngx_http_parse_header_line(ngx_http_request_t *r, ngx_buf_t *b,
/* first char */
case sw_start:
+ r->header_name_start = p;
r->invalid_header = 0;
switch (ch) {
@@ -751,7 +752,6 @@ ngx_http_parse_header_line(ngx_http_request_t *r, ngx_buf_t *b,
goto header_done;
default:
state = sw_name;
- r->header_name_start = p;
c = lowcase[ch];
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index c8976498c..25b2aff74 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -893,9 +893,10 @@ ngx_http_process_request_line(ngx_event_t *rev)
static void
ngx_http_process_request_headers(ngx_event_t *rev)
{
+ u_char *p;
+ size_t len;
ssize_t n;
ngx_int_t rc, rv;
- ngx_str_t header;
ngx_table_elt_t *h;
ngx_connection_t *c;
ngx_http_header_t *hh;
@@ -935,19 +936,17 @@ 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++] = '.';
+ len = r->header_in->end - r->header_name_start;
+ p = r->header_name_start;
+
+ if (len > NGX_MAX_ERROR_STR - 300) {
+ len = NGX_MAX_ERROR_STR - 300;
+ p[len++] = '.'; p[len++] = '.'; p[len++] = '.';
}
ngx_log_error(NGX_LOG_INFO, c->log, 0,
- "client sent too long header line: \"%V\"",
- &header);
+ "client sent too long header line: \"%*s\"",
+ len, r->header_name_start);
ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);
return;
}
@@ -969,12 +968,10 @@ ngx_http_process_request_headers(ngx_event_t *rev)
/* there was error while a header line parsing */
- header.len = r->header_end - r->header_name_start;
- header.data = r->header_name_start;
-
ngx_log_error(NGX_LOG_INFO, c->log, 0,
- "client sent invalid header line: \"%V\"",
- &header);
+ "client sent invalid header line: \"%*s\"",
+ r->header_end - r->header_name_start,
+ r->header_name_start);
continue;
}
@@ -1054,11 +1051,10 @@ ngx_http_process_request_headers(ngx_event_t *rev)
/* rc == NGX_HTTP_PARSE_INVALID_HEADER: "\r" is not followed by "\n" */
- header.len = r->header_end - r->header_name_start;
- header.data = r->header_name_start;
ngx_log_error(NGX_LOG_INFO, c->log, 0,
- "client sent invalid header line: \"%V\\r...\"",
- &header);
+ "client sent invalid header line: \"%*s\\r...\"",
+ r->header_end - r->header_name_start,
+ r->header_name_start);
ngx_http_finalize_request(r, NGX_HTTP_BAD_REQUEST);
return;
}
diff --git a/src/http/ngx_http_request.h b/src/http/ngx_http_request.h
index 2ca215377..3bd70c33c 100644
--- a/src/http/ngx_http_request.h
+++ b/src/http/ngx_http_request.h
@@ -547,7 +547,7 @@ struct ngx_http_request_s {
typedef struct {
ngx_http_posted_request_t terminal_posted_request;
#if (NGX_HAVE_AIO_SENDFILE)
- u_char preload[4];
+ u_char aio_preload;
#endif
} ngx_http_ephemeral_t;
diff --git a/src/http/ngx_http_request_body.c b/src/http/ngx_http_request_body.c
index 775bb2642..d29314747 100644
--- a/src/http/ngx_http_request_body.c
+++ b/src/http/ngx_http_request_body.c
@@ -477,6 +477,7 @@ ngx_http_discard_request_body(ngx_http_request_t *r)
return NGX_HTTP_INTERNAL_SERVER_ERROR;
}
+ r->count++;
(void) ngx_http_read_discarded_request_body(r);
return NGX_OK;
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
index 9aa797ac0..6f15c044d 100644
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -2113,6 +2113,10 @@ ngx_http_upstream_send_response(ngx_http_request_t *r, ngx_http_upstream_t *u)
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, c->log, 0,
"http cacheable: %d", u->cacheable);
+ if (u->cacheable == 0 && r->cache) {
+ ngx_http_file_cache_free(r, u->pipe->temp_file);
+ }
+
#endif
p = u->pipe;
diff --git a/src/os/unix/ngx_freebsd_sendfile_chain.c b/src/os/unix/ngx_freebsd_sendfile_chain.c
index 976b6d0b4..70cdb7495 100644
--- a/src/os/unix/ngx_freebsd_sendfile_chain.c
+++ b/src/os/unix/ngx_freebsd_sendfile_chain.c
@@ -295,14 +295,13 @@ ngx_freebsd_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
ngx_log_debug1(NGX_LOG_DEBUG_EVENT, c->log, err,
"sendfile() sent only %O bytes", sent);
- }
/*
* sendfile() in FreeBSD 3.x-4.x may return value >= 0
* on success, although only 0 is documented
*/
- if (rc >= 0 && sent == 0) {
+ } else if (rc >= 0 && sent == 0) {
/*
* if rc is OK and sent equal to zero, then someone
@@ -311,8 +310,8 @@ ngx_freebsd_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
*/
ngx_log_error(NGX_LOG_ALERT, c->log, 0,
- "sendfile() reported that \"%s\" was truncated",
- file->file->name.data);
+ "sendfile() reported that \"%s\" was truncated at %O",
+ file->file->name.data, file->file_pos);
return NGX_CHAIN_ERROR;
}