Navigation Menu

Skip to content

Commit

Permalink
nginx: update latest release
Browse files Browse the repository at this point in the history
  $ ./update_nginx.sh 1.11.13
  • Loading branch information
kenhys committed Apr 6, 2017
1 parent 205483e commit dbefb40
Show file tree
Hide file tree
Showing 444 changed files with 371 additions and 226 deletions.
2 changes: 1 addition & 1 deletion nginx_version
@@ -1 +1 @@
1.11.12
1.11.13
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -5,6 +5,97 @@
<change_log title="nginx">


<changes ver="1.11.13" date="2017-04-04">

<change type="feature">
<para lang="ru">
параметр http_429 в директивах proxy_next_upstream, fastcgi_next_upstream,
scgi_next_upstream и uwsgi_next_upstream.<br/>
Спасибо Piotr Sikora.
</para>
<para lang="en">
the "http_429" parameter of the "proxy_next_upstream", "fastcgi_next_upstream",
"scgi_next_upstream", and "uwsgi_next_upstream" directives.<br/>
Thanks to Piotr Sikora.
</para>
</change>

<change type="bugfix">
<para lang="ru">
в обработке ошибок выделения памяти.
</para>
<para lang="en">
in memory allocation error handling.
</para>
</change>

<change type="bugfix">
<para lang="ru">
при использовании директив sendfile и timer_resolution на Linux
запросы могли зависать.
</para>
<para lang="en">
requests might hang
when using the "sendfile" and "timer_resolution" directives on Linux.
</para>
</change>

<change type="bugfix">
<para lang="ru">
при использовании с подзапросами директив sendfile и aio_write
запросы могли зависать.
</para>
<para lang="en">
requests might hang
when using the "sendfile" and "aio_write" directives with subrequests.
</para>
</change>

<change type="bugfix">
<para lang="ru">
в модуле ngx_http_v2_module.<br/>
Спасибо Piotr Sikora.
</para>
<para lang="en">
in the ngx_http_v2_module.<br/>
Thanks to Piotr Sikora.
</para>
</change>

<change type="bugfix">
<para lang="ru">
при использовании HTTP/2 в рабочем процессе мог произойти segmentation fault.
</para>
<para lang="en">
a segmentation fault might occur in a worker process when using HTTP/2.
</para>
</change>

<change type="bugfix">
<para lang="ru">
запросы могли зависать
при использовании с подзапросами директив limit_rate, sendfile_max_chunk,
limit_req или метода $r->sleep() встроенного перла.
</para>
<para lang="en">
requests might hang
when using the "limit_rate", "sendfile_max_chunk", "limit_req" directives,
or the $r->sleep() embedded perl method with subrequests.
</para>
</change>

<change type="bugfix">
<para lang="ru">
в модуле ngx_http_slice_module.
</para>
<para lang="en">
in the ngx_http_slice_module.
</para>
</change>

</changes>


<changes ver="1.11.12" date="2017-03-24">

<change type="bugfix">
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -9,8 +9,8 @@
#define _NGINX_H_INCLUDED_


#define nginx_version 1011012
#define NGINX_VERSION "1.11.12"
#define nginx_version 1011013
#define NGINX_VERSION "1.11.13"
#define NGINX_VER "nginx/" NGINX_VERSION

#ifdef NGX_BUILD
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -115,16 +115,14 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)

n = old_cycle->paths.nelts ? old_cycle->paths.nelts : 10;

cycle->paths.elts = ngx_pcalloc(pool, n * sizeof(ngx_path_t *));
if (cycle->paths.elts == NULL) {
if (ngx_array_init(&cycle->paths, pool, n, sizeof(ngx_path_t *))
!= NGX_OK)
{
ngx_destroy_pool(pool);
return NULL;
}

cycle->paths.nelts = 0;
cycle->paths.size = sizeof(ngx_path_t *);
cycle->paths.nalloc = n;
cycle->paths.pool = pool;
ngx_memzero(cycle->paths.elts, n * sizeof(ngx_path_t *));


if (ngx_array_init(&cycle->config_dump, pool, 1, sizeof(ngx_conf_dump_t))
Expand Down Expand Up @@ -175,16 +173,14 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)

n = old_cycle->listening.nelts ? old_cycle->listening.nelts : 10;

cycle->listening.elts = ngx_pcalloc(pool, n * sizeof(ngx_listening_t));
if (cycle->listening.elts == NULL) {
if (ngx_array_init(&cycle->listening, pool, n, sizeof(ngx_listening_t))
!= NGX_OK)
{
ngx_destroy_pool(pool);
return NULL;
}

cycle->listening.nelts = 0;
cycle->listening.size = sizeof(ngx_listening_t);
cycle->listening.nalloc = n;
cycle->listening.pool = pool;
ngx_memzero(cycle->listening.elts, n * sizeof(ngx_listening_t));


ngx_queue_init(&cycle->reusable_connections_queue);
Expand Down Expand Up @@ -768,15 +764,15 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)
}

n = 10;
ngx_old_cycles.elts = ngx_pcalloc(ngx_temp_pool,
n * sizeof(ngx_cycle_t *));
if (ngx_old_cycles.elts == NULL) {

if (ngx_array_init(&ngx_old_cycles, ngx_temp_pool, n,
sizeof(ngx_cycle_t *))
!= NGX_OK)
{
exit(1);
}
ngx_old_cycles.nelts = 0;
ngx_old_cycles.size = sizeof(ngx_cycle_t *);
ngx_old_cycles.nalloc = n;
ngx_old_cycles.pool = ngx_temp_pool;

ngx_memzero(ngx_old_cycles.elts, n * sizeof(ngx_cycle_t *));

ngx_cleaner_event.handler = ngx_clean_old_cycles;
ngx_cleaner_event.log = cycle->log;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Expand Up @@ -500,8 +500,7 @@ ngx_event_module_init(ngx_cycle_t *cycle)
#endif

shm.size = size;
shm.name.len = sizeof("nginx_shared_zone") - 1;
shm.name.data = (u_char *) "nginx_shared_zone";
ngx_str_set(&shm.name, "nginx_shared_zone");
shm.log = cycle->log;

if (ngx_shm_alloc(&shm) != NGX_OK) {
Expand Down
File renamed without changes.
Expand Up @@ -211,6 +211,7 @@ static ngx_conf_bitmask_t ngx_http_fastcgi_next_upstream_masks[] = {
{ ngx_string("http_503"), NGX_HTTP_UPSTREAM_FT_HTTP_503 },
{ ngx_string("http_403"), NGX_HTTP_UPSTREAM_FT_HTTP_403 },
{ ngx_string("http_404"), NGX_HTTP_UPSTREAM_FT_HTTP_404 },
{ ngx_string("http_429"), NGX_HTTP_UPSTREAM_FT_HTTP_429 },
{ ngx_string("updating"), NGX_HTTP_UPSTREAM_FT_UPDATING },
{ ngx_string("off"), NGX_HTTP_UPSTREAM_FT_OFF },
{ ngx_null_string, 0 }
Expand Down
Expand Up @@ -217,13 +217,13 @@ ngx_http_index_handler(ngx_http_request_t *r)
if (ngx_open_cached_file(clcf->open_file_cache, &path, &of, r->pool)
!= NGX_OK)
{
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, of.err,
"%s \"%s\" failed", of.failed, path.data);

if (of.err == 0) {
return NGX_HTTP_INTERNAL_SERVER_ERROR;
}

ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, of.err,
"%s \"%s\" failed", of.failed, path.data);

#if (NGX_HAVE_OPENAT)
if (of.err == NGX_EMLINK
|| of.err == NGX_ELOOP)
Expand Down
Expand Up @@ -276,6 +276,8 @@ ngx_http_limit_req_handler(ngx_http_request_t *r)

r->read_event_handler = ngx_http_test_reading;
r->write_event_handler = ngx_http_limit_req_delay;

r->connection->write->delayed = 1;
ngx_add_timer(r->connection->write, delay);

return NGX_AGAIN;
Expand All @@ -292,7 +294,7 @@ ngx_http_limit_req_delay(ngx_http_request_t *r)

wev = r->connection->write;

if (!wev->timedout) {
if (wev->delayed) {

if (ngx_handle_write_event(wev, 0) != NGX_OK) {
ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
Expand All @@ -301,8 +303,6 @@ ngx_http_limit_req_delay(ngx_http_request_t *r)
return;
}

wev->timedout = 0;

if (ngx_handle_read_event(r->connection->read, 0) != NGX_OK) {
ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
return;
Expand Down
Expand Up @@ -552,6 +552,11 @@ ngx_http_log_script_write(ngx_http_request_t *r, ngx_http_log_script_t *script,
if (ngx_open_cached_file(llcf->open_file_cache, &log, &of, r->pool)
!= NGX_OK)
{
if (of.err == 0) {
/* simulate successful logging */
return len;
}

ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno,
"%s \"%s\" failed", of.failed, log.data);
/* simulate successful logging */
Expand Down
Expand Up @@ -220,6 +220,7 @@ static ngx_conf_bitmask_t ngx_http_proxy_next_upstream_masks[] = {
{ ngx_string("http_504"), NGX_HTTP_UPSTREAM_FT_HTTP_504 },
{ ngx_string("http_403"), NGX_HTTP_UPSTREAM_FT_HTTP_403 },
{ ngx_string("http_404"), NGX_HTTP_UPSTREAM_FT_HTTP_404 },
{ ngx_string("http_429"), NGX_HTTP_UPSTREAM_FT_HTTP_429 },
{ ngx_string("updating"), NGX_HTTP_UPSTREAM_FT_UPDATING },
{ ngx_string("off"), NGX_HTTP_UPSTREAM_FT_OFF },
{ ngx_null_string, 0 }
Expand Down
Expand Up @@ -82,6 +82,7 @@ static ngx_conf_bitmask_t ngx_http_scgi_next_upstream_masks[] = {
{ ngx_string("http_503"), NGX_HTTP_UPSTREAM_FT_HTTP_503 },
{ ngx_string("http_403"), NGX_HTTP_UPSTREAM_FT_HTTP_403 },
{ ngx_string("http_404"), NGX_HTTP_UPSTREAM_FT_HTTP_404 },
{ ngx_string("http_429"), NGX_HTTP_UPSTREAM_FT_HTTP_429 },
{ ngx_string("updating"), NGX_HTTP_UPSTREAM_FT_UPDATING },
{ ngx_string("off"), NGX_HTTP_UPSTREAM_FT_OFF },
{ ngx_null_string, 0 }
Expand Down
Expand Up @@ -11,23 +11,25 @@


typedef struct {
size_t size;
size_t size;
} ngx_http_slice_loc_conf_t;


typedef struct {
off_t start;
off_t end;
ngx_str_t range;
ngx_str_t etag;
ngx_uint_t last; /* unsigned last:1; */
off_t start;
off_t end;
ngx_str_t range;
ngx_str_t etag;
unsigned last:1;
unsigned active:1;
ngx_http_request_t *sr;
} ngx_http_slice_ctx_t;


typedef struct {
off_t start;
off_t end;
off_t complete_length;
off_t start;
off_t end;
off_t complete_length;
} ngx_http_slice_content_range_t;


Expand Down Expand Up @@ -169,6 +171,7 @@ ngx_http_slice_header_filter(ngx_http_request_t *r)
}

ctx->start = end;
ctx->active = 1;

r->headers_out.status = NGX_HTTP_OK;
r->headers_out.status_line.len = 0;
Expand Down Expand Up @@ -209,7 +212,6 @@ ngx_http_slice_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
{
ngx_int_t rc;
ngx_chain_t *cl;
ngx_http_request_t *sr;
ngx_http_slice_ctx_t *ctx;
ngx_http_slice_loc_conf_t *slcf;

Expand All @@ -234,6 +236,16 @@ ngx_http_slice_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
return rc;
}

if (ctx->sr && !ctx->sr->done) {
return rc;
}

if (!ctx->active) {
ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
"missing slice response");
return NGX_ERROR;
}

if (ctx->start >= ctx->end) {
ngx_http_set_ctx(r, NULL, ngx_http_slice_filter_module);
ngx_http_send_special(r, NGX_HTTP_LAST);
Expand All @@ -244,21 +256,23 @@ ngx_http_slice_body_filter(ngx_http_request_t *r, ngx_chain_t *in)
return rc;
}

if (ngx_http_subrequest(r, &r->uri, &r->args, &sr, NULL,
if (ngx_http_subrequest(r, &r->uri, &r->args, &ctx->sr, NULL,
NGX_HTTP_SUBREQUEST_CLONE)
!= NGX_OK)
{
return NGX_ERROR;
}

ngx_http_set_ctx(sr, ctx, ngx_http_slice_filter_module);
ngx_http_set_ctx(ctx->sr, ctx, ngx_http_slice_filter_module);

slcf = ngx_http_get_module_loc_conf(r, ngx_http_slice_filter_module);

ctx->range.len = ngx_sprintf(ctx->range.data, "bytes=%O-%O", ctx->start,
ctx->start + (off_t) slcf->size - 1)
- ctx->range.data;

ctx->active = 0;

ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"http slice subrequest: \"%V\"", &ctx->range);

Expand Down
Expand Up @@ -114,6 +114,7 @@ static ngx_conf_bitmask_t ngx_http_uwsgi_next_upstream_masks[] = {
{ ngx_string("http_503"), NGX_HTTP_UPSTREAM_FT_HTTP_503 },
{ ngx_string("http_403"), NGX_HTTP_UPSTREAM_FT_HTTP_403 },
{ ngx_string("http_404"), NGX_HTTP_UPSTREAM_FT_HTTP_404 },
{ ngx_string("http_429"), NGX_HTTP_UPSTREAM_FT_HTTP_429 },
{ ngx_string("updating"), NGX_HTTP_UPSTREAM_FT_UPDATING },
{ ngx_string("off"), NGX_HTTP_UPSTREAM_FT_OFF },
{ ngx_null_string, 0 }
Expand Down
Expand Up @@ -1001,6 +1001,7 @@ sleep(r, sleep, next)

ctx->next = SvRV(ST(2));

r->connection->write->delayed = 1;
ngx_add_timer(r->connection->write, sleep);

r->write_event_handler = ngx_http_perl_sleep_handler;
Expand Down
Expand Up @@ -278,15 +278,16 @@ ngx_http_perl_sleep_handler(ngx_http_request_t *r)

wev = r->connection->write;

if (wev->timedout) {
wev->timedout = 0;
ngx_http_perl_handle_request(r);
if (wev->delayed) {

if (ngx_handle_write_event(wev, 0) != NGX_OK) {
ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
}

return;
}

if (ngx_handle_write_event(wev, 0) != NGX_OK) {
ngx_http_finalize_request(r, NGX_HTTP_INTERNAL_SERVER_ERROR);
}
ngx_http_perl_handle_request(r);
}


Expand Down
File renamed without changes.
File renamed without changes.

0 comments on commit dbefb40

Please sign in to comment.