summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNGINX team <nginx@nginx.org>2012-04-23 13:32:31 +0000
committerJon Kolb <jon@b0g.us>2012-04-23 13:32:31 +0000
commitceea69f25b435e4941c1c93f2cde7b8d0dcc31ce (patch)
treed4fddaa364a6ee8b2e78434bb796734ac713e36e
parented2df87c83d3a68ab2a395d4c2549dbe26e86ab0 (diff)
downloadnginx-ceea69f25b435e4941c1c93f2cde7b8d0dcc31ce.tar.gz
Changes with nginx 1.2.0 23 Apr 2012v1.2.0
*) Bugfix: a segmentation fault might occur in a worker process if the "try_files" directive was used; the bug had appeared in 1.1.19. *) Bugfix: response might be truncated if there were more than IOV_MAX buffers used. *) Bugfix: in the "crop" parameter of the "image_filter" directive. Thanks to Maxim Bublis.
-rw-r--r--CHANGES12
-rw-r--r--CHANGES.ru12
-rw-r--r--src/core/nginx.c2
-rw-r--r--src/core/nginx.h4
-rw-r--r--src/core/ngx_conf_file.c5
-rw-r--r--src/core/ngx_string.c35
-rw-r--r--src/event/ngx_event.c39
-rw-r--r--src/http/modules/ngx_http_fastcgi_module.c14
-rw-r--r--src/http/modules/ngx_http_geo_module.c6
-rw-r--r--src/http/modules/ngx_http_image_filter_module.c4
-rw-r--r--src/http/modules/ngx_http_proxy_module.c40
-rw-r--r--src/http/modules/ngx_http_scgi_module.c12
-rw-r--r--src/http/modules/ngx_http_split_clients_module.c2
-rw-r--r--src/http/modules/ngx_http_ssi_filter_module.c6
-rw-r--r--src/http/modules/ngx_http_uwsgi_module.c12
-rw-r--r--src/http/modules/perl/nginx.pm2
-rw-r--r--src/http/ngx_http_core_module.c2
-rw-r--r--src/http/ngx_http_request.c6
-rw-r--r--src/http/ngx_http_request_body.c2
-rw-r--r--src/os/unix/ngx_darwin_sendfile_chain.c16
-rw-r--r--src/os/unix/ngx_freebsd_sendfile_chain.c16
-rw-r--r--src/os/unix/ngx_linux_sendfile_chain.c10
-rw-r--r--src/os/unix/ngx_readv_chain.c8
-rw-r--r--src/os/unix/ngx_solaris_sendfilev_chain.c14
-rw-r--r--src/os/unix/ngx_writev_chain.c10
25 files changed, 189 insertions, 102 deletions
diff --git a/CHANGES b/CHANGES
index 61de9a629..75026b6bc 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,16 @@
+Changes with nginx 1.2.0 23 Apr 2012
+
+ *) Bugfix: a segmentation fault might occur in a worker process if the
+ "try_files" directive was used; the bug had appeared in 1.1.19.
+
+ *) Bugfix: response might be truncated if there were more than IOV_MAX
+ buffers used.
+
+ *) Bugfix: in the "crop" parameter of the "image_filter" directive.
+ Thanks to Maxim Bublis.
+
+
Changes with nginx 1.1.19 12 Apr 2012
*) Security: specially crafted mp4 file might allow to overwrite memory
diff --git a/CHANGES.ru b/CHANGES.ru
index 551ab53cf..9d6268807 100644
--- a/CHANGES.ru
+++ b/CHANGES.ru
@@ -1,4 +1,16 @@
+Изменения в nginx 1.2.0 23.04.2012
+
+ *) Исправление: в рабочем процессе мог произойти segmentation fault,
+ если использовалась директива try_files; ошибка появилась в 1.1.19.
+
+ *) Исправление: ответ мог быть передан не полностью, если использовалось
+ больше IOV_MAX буферов.
+
+ *) Исправление: в работе параметра crop директивы image_filter.
+ Спасибо Maxim Bublis.
+
+
Изменения в nginx 1.1.19 12.04.2012
*) Безопасность: при обработке специально созданного mp4 файла модулем
diff --git a/src/core/nginx.c b/src/core/nginx.c
index 19feb0700..f21e77d30 100644
--- a/src/core/nginx.c
+++ b/src/core/nginx.c
@@ -649,7 +649,7 @@ ngx_exec_new_binary(ngx_cycle_t *cycle, char *const *argv)
if (ngx_rename_file(ccf->oldpid.data, ccf->pid.data) != NGX_OK) {
ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
ngx_rename_file_n " %s back to %s failed after "
- "the try to execute the new binary process \"%s\"",
+ "an attempt to execute new binary process \"%s\"",
ccf->oldpid.data, ccf->pid.data, argv[0]);
}
}
diff --git a/src/core/nginx.h b/src/core/nginx.h
index 3e147dcb7..ca777f6d5 100644
--- a/src/core/nginx.h
+++ b/src/core/nginx.h
@@ -9,8 +9,8 @@
#define _NGINX_H_INCLUDED_
-#define nginx_version 1001019
-#define NGINX_VERSION "1.1.19"
+#define nginx_version 1002000
+#define NGINX_VERSION "1.2.0"
#define NGINX_VER "nginx/" NGINX_VERSION
#define NGINX_VAR "NGINX"
diff --git a/src/core/ngx_conf_file.c b/src/core/ngx_conf_file.c
index 6d998a5f0..892fa4719 100644
--- a/src/core/ngx_conf_file.c
+++ b/src/core/ngx_conf_file.c
@@ -465,7 +465,7 @@ ngx_conf_read_token(ngx_conf_t *cf)
if (cf->conf_file->file.offset >= file_size) {
- if (cf->args->nelts > 0) {
+ if (cf->args->nelts > 0 || !last_space) {
if (cf->conf_file->file.fd == NGX_INVALID_FILE) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
@@ -1481,7 +1481,8 @@ ngx_conf_check_num_bounds(ngx_conf_t *cf, void *post, void *data)
}
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "value must be equal or more than %i", bounds->low);
+ "value must be equal to or greater than %i",
+ bounds->low);
return NGX_CONF_ERROR;
}
diff --git a/src/core/ngx_string.c b/src/core/ngx_string.c
index 1dec96cc4..8aaa1d2ed 100644
--- a/src/core/ngx_string.c
+++ b/src/core/ngx_string.c
@@ -146,12 +146,12 @@ ngx_vslprintf(u_char *buf, u_char *last, const char *fmt, va_list args)
{
u_char *p, zero;
int d;
- double f, scale;
+ double f;
size_t len, slen;
int64_t i64;
- uint64_t ui64;
+ uint64_t ui64, frac;
ngx_msec_t ms;
- ngx_uint_t width, sign, hex, max_width, frac_width, n;
+ ngx_uint_t width, sign, hex, max_width, frac_width, scale, n;
ngx_str_t *v;
ngx_variable_value_t *vv;
@@ -365,28 +365,31 @@ ngx_vslprintf(u_char *buf, u_char *last, const char *fmt, va_list args)
}
ui64 = (int64_t) f;
-
- buf = ngx_sprintf_num(buf, last, ui64, zero, 0, width);
+ frac = 0;
if (frac_width) {
- if (buf < last) {
- *buf++ = '.';
+ scale = 1;
+ for (n = frac_width; n; n--) {
+ scale *= 10;
}
- scale = 1.0;
+ frac = (uint64_t) ((f - (double) ui64) * scale + 0.5);
- for (n = frac_width; n; n--) {
- scale *= 10.0;
+ if (frac == scale) {
+ ui64++;
+ frac = 0;
}
+ }
- /*
- * (int64_t) cast is required for msvc6:
- * it cannot convert uint64_t to double
- */
- ui64 = (uint64_t) ((f - (int64_t) ui64) * scale + 0.5);
+ buf = ngx_sprintf_num(buf, last, ui64, zero, 0, width);
+
+ if (frac_width) {
+ if (buf < last) {
+ *buf++ = '.';
+ }
- buf = ngx_sprintf_num(buf, last, ui64, '0', 0, frac_width);
+ buf = ngx_sprintf_num(buf, last, frac, '0', 0, frac_width);
}
fmt++;
diff --git a/src/event/ngx_event.c b/src/event/ngx_event.c
index 3d83b8e75..a0a9d743b 100644
--- a/src/event/ngx_event.c
+++ b/src/event/ngx_event.c
@@ -21,6 +21,7 @@ extern ngx_module_t ngx_rtsig_module;
extern ngx_module_t ngx_select_module;
+static char *ngx_event_init_conf(ngx_cycle_t *cycle, void *conf);
static ngx_int_t ngx_event_module_init(ngx_cycle_t *cycle);
static ngx_int_t ngx_event_process_init(ngx_cycle_t *cycle);
static char *ngx_events_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
@@ -31,8 +32,8 @@ static char *ngx_event_use(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
static char *ngx_event_debug_connection(ngx_conf_t *cf, ngx_command_t *cmd,
void *conf);
-static void *ngx_event_create_conf(ngx_cycle_t *cycle);
-static char *ngx_event_init_conf(ngx_cycle_t *cycle, void *conf);
+static void *ngx_event_core_create_conf(ngx_cycle_t *cycle);
+static char *ngx_event_core_init_conf(ngx_cycle_t *cycle, void *conf);
static ngx_uint_t ngx_timer_resolution;
@@ -93,7 +94,7 @@ static ngx_command_t ngx_events_commands[] = {
static ngx_core_module_t ngx_events_module_ctx = {
ngx_string("events"),
NULL,
- NULL
+ ngx_event_init_conf
};
@@ -173,8 +174,8 @@ static ngx_command_t ngx_event_core_commands[] = {
ngx_event_module_t ngx_event_core_module_ctx = {
&event_core_name,
- ngx_event_create_conf, /* create configuration */
- ngx_event_init_conf, /* init configuration */
+ ngx_event_core_create_conf, /* create configuration */
+ ngx_event_core_init_conf, /* init configuration */
{ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }
};
@@ -423,6 +424,19 @@ ngx_handle_write_event(ngx_event_t *wev, size_t lowat)
}
+static char *
+ngx_event_init_conf(ngx_cycle_t *cycle, void *conf)
+{
+ if (ngx_get_conf(cycle->conf_ctx, ngx_events_module) == NULL) {
+ ngx_log_error(NGX_LOG_EMERG, cycle->log, 0,
+ "no \"events\" section in configuration");
+ return NGX_CONF_ERROR;
+ }
+
+ return NGX_CONF_OK;
+}
+
+
static ngx_int_t
ngx_event_module_init(ngx_cycle_t *cycle)
{
@@ -435,13 +449,6 @@ ngx_event_module_init(ngx_cycle_t *cycle)
ngx_event_conf_t *ecf;
cf = ngx_get_conf(cycle->conf_ctx, ngx_events_module);
-
- if (cf == NULL) {
- ngx_log_error(NGX_LOG_EMERG, cycle->log, 0,
- "no \"events\" section in configuration");
- return NGX_ERROR;
- }
-
ecf = (*cf)[ngx_event_core_module.ctx_index];
if (!ngx_test_config && ngx_process <= NGX_PROCESS_MASTER) {
@@ -471,7 +478,7 @@ ngx_event_module_init(ngx_cycle_t *cycle)
(ngx_int_t) rlmt.rlim_cur : ccf->rlimit_nofile;
ngx_log_error(NGX_LOG_WARN, cycle->log, 0,
- "%ui worker_connections are more than "
+ "%ui worker_connections exceed "
"open file resource limit: %i",
ecf->connections, limit);
}
@@ -489,7 +496,7 @@ ngx_event_module_init(ngx_cycle_t *cycle)
}
- /* cl should be equal or bigger than cache line size */
+ /* cl should be equal to or greater than cache line size */
cl = 128;
@@ -1116,7 +1123,7 @@ ngx_event_debug_connection(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
static void *
-ngx_event_create_conf(ngx_cycle_t *cycle)
+ngx_event_core_create_conf(ngx_cycle_t *cycle)
{
ngx_event_conf_t *ecf;
@@ -1147,7 +1154,7 @@ ngx_event_create_conf(ngx_cycle_t *cycle)
static char *
-ngx_event_init_conf(ngx_cycle_t *cycle, void *conf)
+ngx_event_core_init_conf(ngx_cycle_t *cycle, void *conf)
{
ngx_event_conf_t *ecf = conf;
diff --git a/src/http/modules/ngx_http_fastcgi_module.c b/src/http/modules/ngx_http_fastcgi_module.c
index 361b1c8db..3bc994a80 100644
--- a/src/http/modules/ngx_http_fastcgi_module.c
+++ b/src/http/modules/ngx_http_fastcgi_module.c
@@ -1254,7 +1254,7 @@ ngx_http_fastcgi_process_header(ngx_http_request_t *r)
if (f->type == NGX_HTTP_FASTCGI_STDOUT && f->length == 0) {
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "upstream closed prematurely FastCGI stdout");
+ "upstream prematurely closed FastCGI stdout");
return NGX_HTTP_UPSTREAM_INVALID_HEADER;
}
@@ -2198,8 +2198,8 @@ ngx_http_fastcgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
if (conf->upstream.busy_buffers_size < size) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"fastcgi_busy_buffers_size\" must be equal or bigger than "
- "maximum of the value of \"fastcgi_buffer_size\" and "
+ "\"fastcgi_busy_buffers_size\" must be equal to or greater than "
+ "the maximum of the value of \"fastcgi_buffer_size\" and "
"one of the \"fastcgi_buffers\"");
return NGX_CONF_ERROR;
@@ -2229,8 +2229,8 @@ ngx_http_fastcgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
if (conf->upstream.temp_file_write_size < size) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"fastcgi_temp_file_write_size\" must be equal or bigger than "
- "maximum of the value of \"fastcgi_buffer_size\" and "
+ "\"fastcgi_temp_file_write_size\" must be equal to or greater "
+ "than the maximum of the value of \"fastcgi_buffer_size\" and "
"one of the \"fastcgi_buffers\"");
return NGX_CONF_ERROR;
@@ -2253,8 +2253,8 @@ ngx_http_fastcgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
{
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"\"fastcgi_max_temp_file_size\" must be equal to zero to disable "
- "the temporary files usage or must be equal or bigger than "
- "maximum of the value of \"fastcgi_buffer_size\" and "
+ "temporary files usage or must be equal to or greater than "
+ "the maximum of the value of \"fastcgi_buffer_size\" and "
"one of the \"fastcgi_buffers\"");
return NGX_CONF_ERROR;
diff --git a/src/http/modules/ngx_http_geo_module.c b/src/http/modules/ngx_http_geo_module.c
index 1d7599e55..30b0e35a9 100644
--- a/src/http/modules/ngx_http_geo_module.c
+++ b/src/http/modules/ngx_http_geo_module.c
@@ -566,7 +566,7 @@ ngx_http_geo_range(ngx_conf_t *cf, ngx_http_geo_conf_ctx_t *ctx,
if (ctx->binary_include) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "binary geo range base \"%s\" may not be mixed with usual entries",
+ "binary geo range base \"%s\" cannot be mixed with usual entries",
ctx->include_name.data);
return NGX_CONF_ERROR;
}
@@ -1195,7 +1195,7 @@ ngx_http_geo_include_binary_base(ngx_conf_t *cf, ngx_http_geo_conf_ctx_t *ctx,
if (ctx->outside_entries) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "binary geo range base \"%s\" may not be mixed with usual entries",
+ "binary geo range base \"%s\" cannot be mixed with usual entries",
name->data);
rc = NGX_ERROR;
goto done;
@@ -1203,7 +1203,7 @@ ngx_http_geo_include_binary_base(ngx_conf_t *cf, ngx_http_geo_conf_ctx_t *ctx,
if (ctx->binary_include) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "second binary geo range base \"%s\" may not be mixed with \"%s\"",
+ "second binary geo range base \"%s\" cannot be mixed with \"%s\"",
name->data, ctx->include_name.data);
rc = NGX_ERROR;
goto done;
diff --git a/src/http/modules/ngx_http_image_filter_module.c b/src/http/modules/ngx_http_image_filter_module.c
index dd3c9cee5..c853c33d0 100644
--- a/src/http/modules/ngx_http_image_filter_module.c
+++ b/src/http/modules/ngx_http_image_filter_module.c
@@ -817,9 +817,7 @@ transparent:
resize = 0;
- if ((ngx_uint_t) (dx * 100 / dy)
- < ctx->max_width * 100 / ctx->max_height)
- {
+ if ((double) dx / dy < (double) ctx->max_width / ctx->max_height) {
if ((ngx_uint_t) dx > ctx->max_width) {
dy = dy * ctx->max_width / dx;
dy = dy ? dy : 1;
diff --git a/src/http/modules/ngx_http_proxy_module.c b/src/http/modules/ngx_http_proxy_module.c
index 1a99e17df..387f77f9b 100644
--- a/src/http/modules/ngx_http_proxy_module.c
+++ b/src/http/modules/ngx_http_proxy_module.c
@@ -1497,6 +1497,10 @@ ngx_http_proxy_input_filter_init(void *data)
u = r->upstream;
ctx = ngx_http_get_module_ctx(r, ngx_http_proxy_module);
+ if (ctx == NULL) {
+ return NGX_ERROR;
+ }
+
ngx_log_debug4(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"http proxy filter init s:%d h:%d c:%d l:%O",
u->headers_in.status_n, ctx->head, u->headers_in.chunked,
@@ -1636,6 +1640,11 @@ ngx_http_proxy_parse_chunked(ngx_http_request_t *r, ngx_buf_t *buf)
} state;
ctx = ngx_http_get_module_ctx(r, ngx_http_proxy_module);
+
+ if (ctx == NULL) {
+ return NGX_ERROR;
+ }
+
state = ctx->state;
if (state == sw_chunk_data && ctx->size == 0) {
@@ -1883,6 +1892,10 @@ ngx_http_proxy_chunked_filter(ngx_event_pipe_t *p, ngx_buf_t *buf)
r = p->input_ctx;
ctx = ngx_http_get_module_ctx(r, ngx_http_proxy_module);
+ if (ctx == NULL) {
+ return NGX_ERROR;
+ }
+
b = NULL;
prev = &buf->shadow;
@@ -2064,6 +2077,11 @@ ngx_http_proxy_non_buffered_chunked_filter(void *data, ssize_t bytes)
ngx_http_proxy_ctx_t *ctx;
ctx = ngx_http_get_module_ctx(r, ngx_http_proxy_module);
+
+ if (ctx == NULL) {
+ return NGX_ERROR;
+ }
+
u = r->upstream;
buf = &u->buffer;
@@ -2734,8 +2752,8 @@ ngx_http_proxy_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
if (conf->upstream.busy_buffers_size < size) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"proxy_busy_buffers_size\" must be equal or bigger than "
- "maximum of the value of \"proxy_buffer_size\" and "
+ "\"proxy_busy_buffers_size\" must be equal to or greater than "
+ "the maximum of the value of \"proxy_buffer_size\" and "
"one of the \"proxy_buffers\"");
return NGX_CONF_ERROR;
@@ -2765,8 +2783,8 @@ ngx_http_proxy_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
if (conf->upstream.temp_file_write_size < size) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"proxy_temp_file_write_size\" must be equal or bigger than "
- "maximum of the value of \"proxy_buffer_size\" and "
+ "\"proxy_temp_file_write_size\" must be equal to or greater "
+ "than the maximum of the value of \"proxy_buffer_size\" and "
"one of the \"proxy_buffers\"");
return NGX_CONF_ERROR;
@@ -2788,8 +2806,8 @@ ngx_http_proxy_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
{
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"\"proxy_max_temp_file_size\" must be equal to zero to disable "
- "the temporary files usage or must be equal or bigger than "
- "maximum of the value of \"proxy_buffer_size\" and "
+ "temporary files usage or must be equal to or greater than "
+ "the maximum of the value of \"proxy_buffer_size\" and "
"one of the \"proxy_buffers\"");
return NGX_CONF_ERROR;
@@ -3425,11 +3443,11 @@ ngx_http_proxy_pass(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
{
if (plcf->vars.uri.len) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"proxy_pass\" may not have URI part in "
+ "\"proxy_pass\" cannot have URI part in "
"location given by regular expression, "
"or inside named location, "
- "or inside the \"if\" statement, "
- "or inside the \"limit_except\" block");
+ "or inside \"if\" statement, "
+ "or inside \"limit_except\" block");
return NGX_CONF_ERROR;
}
@@ -3498,14 +3516,14 @@ ngx_http_proxy_redirect(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
if (ngx_strcmp(value[1].data, "default") == 0) {
if (plcf->proxy_lengths) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"proxy_redirect default\" may not be used "
+ "\"proxy_redirect default\" cannot be used "
"with \"proxy_pass\" directive with variables");
return NGX_CONF_ERROR;
}
if (plcf->url.data == NULL) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"proxy_redirect default\" must go "
+ "\"proxy_redirect default\" should be placed "
"after the \"proxy_pass\" directive");
return NGX_CONF_ERROR;
}
diff --git a/src/http/modules/ngx_http_scgi_module.c b/src/http/modules/ngx_http_scgi_module.c
index a6c8caddf..239da6b94 100644
--- a/src/http/modules/ngx_http_scgi_module.c
+++ b/src/http/modules/ngx_http_scgi_module.c
@@ -1173,8 +1173,8 @@ ngx_http_scgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
if (conf->upstream.busy_buffers_size < size) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"scgi_busy_buffers_size\" must be equal or bigger "
- "than maximum of the value of \"scgi_buffer_size\" and "
+ "\"scgi_busy_buffers_size\" must be equal to or greater "
+ "than the maximum of the value of \"scgi_buffer_size\" and "
"one of the \"scgi_buffers\"");
return NGX_CONF_ERROR;
@@ -1204,8 +1204,8 @@ ngx_http_scgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
if (conf->upstream.temp_file_write_size < size) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"scgi_temp_file_write_size\" must be equal or bigger than "
- "maximum of the value of \"scgi_buffer_size\" and "
+ "\"scgi_temp_file_write_size\" must be equal to or greater than "
+ "the maximum of the value of \"scgi_buffer_size\" and "
"one of the \"scgi_buffers\"");
return NGX_CONF_ERROR;
@@ -1227,8 +1227,8 @@ ngx_http_scgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
&& conf->upstream.max_temp_file_size < size) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"\"scgi_max_temp_file_size\" must be equal to zero to disable "
- "the temporary files usage or must be equal or bigger than "
- "maximum of the value of \"scgi_buffer_size\" and "
+ "temporary files usage or must be equal to or greater than "
+ "the maximum of the value of \"scgi_buffer_size\" and "
"one of the \"scgi_buffers\"");
return NGX_CONF_ERROR;
diff --git a/src/http/modules/ngx_http_split_clients_module.c b/src/http/modules/ngx_http_split_clients_module.c
index 6b1a8155a..726269c3c 100644
--- a/src/http/modules/ngx_http_split_clients_module.c
+++ b/src/http/modules/ngx_http_split_clients_module.c
@@ -177,7 +177,7 @@ ngx_conf_split_clients_block(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
sum = part[i].percent ? sum + part[i].percent : 10000;
if (sum > 10000) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "percent sum is more than 100%%");
+ "percent total is greater than 100%%");
return NGX_CONF_ERROR;
}
diff --git a/src/http/modules/ngx_http_ssi_filter_module.c b/src/http/modules/ngx_http_ssi_filter_module.c
index f47cb429d..219465ae9 100644
--- a/src/http/modules/ngx_http_ssi_filter_module.c
+++ b/src/http/modules/ngx_http_ssi_filter_module.c
@@ -2003,7 +2003,7 @@ ngx_http_ssi_include(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx,
if (set && stub) {
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "\"set\" and \"stub\" may not be used together "
+ "\"set\" and \"stub\" cannot be used together "
"in \"include\" SSI command");
return NGX_HTTP_SSI_ERROR;
}
@@ -2011,7 +2011,7 @@ ngx_http_ssi_include(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx,
if (wait) {
if (uri == NULL) {
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "\"wait\" may not be used with file=\"%V\"", file);
+ "\"wait\" cannot be used with file=\"%V\"", file);
return NGX_HTTP_SSI_ERROR;
}
@@ -2188,7 +2188,7 @@ ngx_http_ssi_include(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx,
} else {
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "only one subrequest may be waited at the same time");
+ "can only wait for one subrequest at a time");
}
return NGX_OK;
diff --git a/src/http/modules/ngx_http_uwsgi_module.c b/src/http/modules/ngx_http_uwsgi_module.c
index 54172bab8..0c999ca62 100644
--- a/src/http/modules/ngx_http_uwsgi_module.c
+++ b/src/http/modules/ngx_http_uwsgi_module.c
@@ -1216,8 +1216,8 @@ ngx_http_uwsgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
if (conf->upstream.busy_buffers_size < size) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"uwsgi_busy_buffers_size\" must be equal or bigger "
- "than maximum of the value of \"uwsgi_buffer_size\" and "
+ "\"uwsgi_busy_buffers_size\" must be equal to or greater "
+ "than the maximum of the value of \"uwsgi_buffer_size\" and "
"one of the \"uwsgi_buffers\"");
return NGX_CONF_ERROR;
@@ -1247,8 +1247,8 @@ ngx_http_uwsgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
if (conf->upstream.temp_file_write_size < size) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
- "\"uwsgi_temp_file_write_size\" must be equal or bigger than "
- "maximum of the value of \"uwsgi_buffer_size\" and "
+ "\"uwsgi_temp_file_write_size\" must be equal to or greater than "
+ "the maximum of the value of \"uwsgi_buffer_size\" and "
"one of the \"uwsgi_buffers\"");
return NGX_CONF_ERROR;
@@ -1270,8 +1270,8 @@ ngx_http_uwsgi_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
&& conf->upstream.max_temp_file_size < size) {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
"\"uwsgi_max_temp_file_size\" must be equal to zero to disable "
- "the temporary files usage or must be equal or bigger than "
- "maximum of the value of \"uwsgi_buffer_size\" and "
+ "temporary files usage or must be equal to or greater than "
+ "the maximum of the value of \"uwsgi_buffer_size\" and "
"one of the \"uwsgi_buffers\"");
return NGX_CONF_ERROR;
diff --git a/src/http/modules/perl/nginx.pm b/src/http/modules/perl/nginx.pm
index 7ec70472d..766b81017 100644
--- a/src/http/modules/perl/nginx.pm
+++ b/src/http/modules/perl/nginx.pm
@@ -50,7 +50,7 @@ our @EXPORT = qw(
HTTP_INSUFFICIENT_STORAGE
);
-our $VERSION = '1.1.19';
+our $VERSION = '1.2.0';
require XSLoader;
XSLoader::load('nginx', $VERSION);
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index 5b7f44aa1..42dd6644e 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -1240,7 +1240,7 @@ ngx_http_core_try_files_phase(ngx_http_request_t *r,
reserve = len > r->uri.len - alias ? len - (r->uri.len - alias) : 0;
}
- if (reserve > allocated) {
+ if (reserve > allocated || !allocated) {
/* 16 bytes are preallocation */
allocated = reserve + 16;
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index 441517ea4..052f379ac 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -612,6 +612,8 @@ ngx_http_ssl_handshake_handler(ngx_connection_t *c)
c->ssl->no_wait_shutdown = 1;
+ c->log->action = "reading client request line";
+
c->read->handler = ngx_http_process_request_line;
/* STUB: epoll edge */ c->write->handler = ngx_http_empty_handler;
@@ -1175,7 +1177,7 @@ ngx_http_read_request_header(ngx_http_request_t *r)
if (n == 0) {
ngx_log_error(NGX_LOG_INFO, c->log, 0,
- "client closed prematurely connection");
+ "client prematurely closed connection");
}
if (n == 0 || n == NGX_ERROR) {
@@ -2426,7 +2428,7 @@ closed:
}
ngx_log_error(NGX_LOG_INFO, c->log, err,
- "client closed prematurely connection");
+ "client prematurely closed connection");
ngx_http_finalize_request(r, 0);
}
diff --git a/src/http/ngx_http_request_body.c b/src/http/ngx_http_request_body.c
index ac09d56f1..bddd7c580 100644
--- a/src/http/ngx_http_request_body.c
+++ b/src/http/ngx_http_request_body.c
@@ -303,7 +303,7 @@ ngx_http_do_read_client_request_body(ngx_http_request_t *r)
if (n == 0) {
ngx_log_error(NGX_LOG_INFO, c->log, 0,
- "client closed prematurely connection");
+ "client prematurely closed connection");
}
if (n == 0 || n == NGX_ERROR) {
diff --git a/src/os/unix/ngx_darwin_sendfile_chain.c b/src/os/unix/ngx_darwin_sendfile_chain.c
index ec247d21b..078d10b24 100644
--- a/src/os/unix/ngx_darwin_sendfile_chain.c
+++ b/src/os/unix/ngx_darwin_sendfile_chain.c
@@ -103,10 +103,8 @@ ngx_darwin_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
prev = NULL;
iov = NULL;
- for (cl = in;
- cl && header.nelts < IOV_MAX && send < limit;
- cl = cl->next)
- {
+ for (cl = in; cl && send < limit; cl = cl->next) {
+
if (ngx_buf_special(cl->buf)) {
continue;
}
@@ -125,6 +123,10 @@ ngx_darwin_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
iov->iov_len += (size_t) size;
} else {
+ if (header.nelts >= IOV_MAX) {
+ break;
+ }
+
iov = ngx_array_push(&header);
if (iov == NULL) {
return NGX_CHAIN_ERROR;
@@ -178,7 +180,7 @@ ngx_darwin_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
prev = NULL;
iov = NULL;
- while (cl && header.nelts < IOV_MAX && send < limit) {
+ while (cl && send < limit) {
if (ngx_buf_special(cl->buf)) {
cl = cl->next;
@@ -199,6 +201,10 @@ ngx_darwin_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
iov->iov_len += (size_t) size;
} else {
+ if (trailer.nelts >= IOV_MAX) {
+ break;
+ }
+
iov = ngx_array_push(&trailer);
if (iov == NULL) {
return NGX_CHAIN_ERROR;
diff --git a/src/os/unix/ngx_freebsd_sendfile_chain.c b/src/os/unix/ngx_freebsd_sendfile_chain.c
index 724bb0d70..f58b5c20f 100644
--- a/src/os/unix/ngx_freebsd_sendfile_chain.c
+++ b/src/os/unix/ngx_freebsd_sendfile_chain.c
@@ -107,10 +107,8 @@ ngx_freebsd_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
prev = NULL;
iov = NULL;
- for (cl = in;
- cl && header.nelts < IOV_MAX && send < limit;
- cl = cl->next)
- {
+ for (cl = in; cl && send < limit; cl = cl->next) {
+
if (ngx_buf_special(cl->buf)) {
continue;
}
@@ -129,6 +127,10 @@ ngx_freebsd_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
iov->iov_len += (size_t) size;
} else {
+ if (header.nelts >= IOV_MAX){
+ break;
+ }
+
iov = ngx_array_push(&header);
if (iov == NULL) {
return NGX_CHAIN_ERROR;
@@ -183,7 +185,7 @@ ngx_freebsd_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
prev = NULL;
iov = NULL;
- while (cl && header.nelts < IOV_MAX && send < limit) {
+ while (cl && send < limit) {
if (ngx_buf_special(cl->buf)) {
cl = cl->next;
@@ -204,6 +206,10 @@ ngx_freebsd_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
iov->iov_len += (size_t) size;
} else {
+ if (trailer.nelts >= IOV_MAX){
+ break;
+ }
+
iov = ngx_array_push(&trailer);
if (iov == NULL) {
return NGX_CHAIN_ERROR;
diff --git a/src/os/unix/ngx_linux_sendfile_chain.c b/src/os/unix/ngx_linux_sendfile_chain.c
index 4f6fdf587..e8f3d5a89 100644
--- a/src/os/unix/ngx_linux_sendfile_chain.c
+++ b/src/os/unix/ngx_linux_sendfile_chain.c
@@ -89,10 +89,8 @@ ngx_linux_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
/* create the iovec and coalesce the neighbouring bufs */
- for (cl = in;
- cl && header.nelts < IOV_MAX && send < limit;
- cl = cl->next)
- {
+ for (cl = in; cl && send < limit; cl = cl->next) {
+
if (ngx_buf_special(cl->buf)) {
continue;
}
@@ -132,6 +130,10 @@ ngx_linux_sendfile_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
iov->iov_len += (size_t) size;
} else {
+ if (header.nelts >= IOV_MAX) {
+ break;
+ }
+
iov = ngx_array_push(&header);
if (iov == NULL) {
return NGX_CHAIN_ERROR;
diff --git a/src/os/unix/ngx_readv_chain.c b/src/os/unix/ngx_readv_chain.c
index 373c4027c..7b6badfa8 100644
--- a/src/os/unix/ngx_readv_chain.c
+++ b/src/os/unix/ngx_readv_chain.c
@@ -71,6 +71,10 @@ ngx_readv_chain(ngx_connection_t *c, ngx_chain_t *chain)
iov->iov_len += chain->buf->end - chain->buf->last;
} else {
+ if (vec.nelts >= IOV_MAX) {
+ break;
+ }
+
iov = ngx_array_push(&vec);
if (iov == NULL) {
return NGX_ERROR;
@@ -195,6 +199,10 @@ ngx_readv_chain(ngx_connection_t *c, ngx_chain_t *chain)
iov->iov_len += chain->buf->end - chain->buf->last;
} else {
+ if (vec.nelts >= IOV_MAX) {
+ break;
+ }
+
iov = ngx_array_push(&vec);
if (iov == NULL) {
return NGX_ERROR;
diff --git a/src/os/unix/ngx_solaris_sendfilev_chain.c b/src/os/unix/ngx_solaris_sendfilev_chain.c
index d68220dc3..f800c15f5 100644
--- a/src/os/unix/ngx_solaris_sendfilev_chain.c
+++ b/src/os/unix/ngx_solaris_sendfilev_chain.c
@@ -74,7 +74,6 @@ ngx_solaris_sendfilev_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
send = 0;
- complete = 0;
vec.elts = sfvs;
vec.size = sizeof(sendfilevec_t);
@@ -87,6 +86,7 @@ ngx_solaris_sendfilev_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
fprev = 0;
sfv = NULL;
eintr = 0;
+ complete = 0;
sent = 0;
prev_send = send;
@@ -94,8 +94,8 @@ ngx_solaris_sendfilev_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
/* create the sendfilevec and coalesce the neighbouring bufs */
- for (cl = in; cl && vec.nelts < IOV_MAX && send < limit; cl = cl->next)
- {
+ for (cl = in; cl && send < limit; cl = cl->next) {
+
if (ngx_buf_special(cl->buf)) {
continue;
}
@@ -113,6 +113,10 @@ ngx_solaris_sendfilev_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
sfv->sfv_len += (size_t) size;
} else {
+ if (vec.nelts >= IOV_MAX) {
+ break;
+ }
+
sfv = ngx_array_push(&vec);
if (sfv == NULL) {
return NGX_CHAIN_ERROR;
@@ -147,6 +151,10 @@ ngx_solaris_sendfilev_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
sfv->sfv_len += (size_t) size;
} else {
+ if (vec.nelts >= IOV_MAX) {
+ break;
+ }
+
sfv = ngx_array_push(&vec);
if (sfv == NULL) {
return NGX_CHAIN_ERROR;
diff --git a/src/os/unix/ngx_writev_chain.c b/src/os/unix/ngx_writev_chain.c
index 579fdecc8..805982d65 100644
--- a/src/os/unix/ngx_writev_chain.c
+++ b/src/os/unix/ngx_writev_chain.c
@@ -54,7 +54,6 @@ ngx_writev_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
}
send = 0;
- complete = 0;
vec.elts = iovs;
vec.size = sizeof(struct iovec);
@@ -65,14 +64,15 @@ ngx_writev_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
prev = NULL;
iov = NULL;
eintr = 0;
+ complete = 0;
prev_send = send;
vec.nelts = 0;
/* create the iovec and coalesce the neighbouring bufs */
- for (cl = in; cl && vec.nelts < IOV_MAX && send < limit; cl = cl->next)
- {
+ for (cl = in; cl && send < limit; cl = cl->next) {
+
if (ngx_buf_special(cl->buf)) {
continue;
}
@@ -93,6 +93,10 @@ ngx_writev_chain(ngx_connection_t *c, ngx_chain_t *in, off_t limit)
iov->iov_len += size;
} else {
+ if (vec.nelts >= IOV_MAX) {
+ break;
+ }
+
iov = ngx_array_push(&vec);
if (iov == NULL) {
return NGX_CHAIN_ERROR;