pull/558/head
James ZHANG 6 years ago
parent 7508c18522
commit e997370ac3

@ -1,6 +1,8 @@
--- nginx-1.17.4/auto/cc/conf 2015-10-30 22:47:50.000000000 +0800
+++ nginx-1.17.4-patched/auto/cc/conf 2015-11-02 12:23:05.385156987 +0800
@@ -136,7 +136,7 @@ fi
diff --git a/auto/cc/conf b/auto/cc/conf
index afbca62b..a1bd8b69 100644
--- a/auto/cc/conf
+++ b/auto/cc/conf
@@ -144,7 +144,7 @@ fi
CFLAGS="$CFLAGS $NGX_CC_OPT"
NGX_TEST_LD_OPT="$NGX_LD_OPT"

@ -1,5 +1,5 @@
diff --git a/src/os/unix/ngx_daemon.c b/src/os/unix/ngx_daemon.c
index ab672110..f259af31 100644
index 385c49b6..2943dd89 100644
--- a/src/os/unix/ngx_daemon.c
+++ b/src/os/unix/ngx_daemon.c
@@ -23,6 +23,8 @@ ngx_daemon(ngx_log_t *log)
@ -10,3 +10,4 @@ index ab672110..f259af31 100644
+ ngx_destroy_pool(ngx_cycle->pool);
exit(0);
}

@ -1063,7 +1063,7 @@ index 00000000..d7d2d45d
+
+#endif /* _NGX_HTTP_PROBE_H_INCLUDED_ */
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index de1b2027..887cf6cd 100644
index 80c19656..6c57db19 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -8,6 +8,7 @@
@ -1074,16 +1074,8 @@ index de1b2027..887cf6cd 100644
static void ngx_http_wait_request_handler(ngx_event_t *ev);
@@ -1091,7 +1092,6 @@ ngx_http_process_request_line(ngx_event_t *rev)
}
}
-
ngx_int_t
ngx_http_process_request_uri(ngx_http_request_t *r)
{
@@ -1348,6 +1348,8 @@ ngx_http_process_request_headers(ngx_event_t *rev)
return;
@@ -1453,6 +1454,8 @@ ngx_http_process_request_headers(ngx_event_t *rev)
break;
}
+ ngx_http_probe_read_req_header_done(r, h);
@ -1091,7 +1083,7 @@ index de1b2027..887cf6cd 100644
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"http header: \"%V: %V\"",
&h->key, &h->value);
@@ -2327,7 +2329,11 @@ ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc)
@@ -2439,7 +2442,11 @@ ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc)
}
if (r != r->main && r->post_subrequest) {
@ -1103,7 +1095,7 @@ index de1b2027..887cf6cd 100644
}
if (rc == NGX_ERROR
@@ -2393,6 +2399,8 @@ ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc)
@@ -2506,6 +2513,8 @@ ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc)
if (r->buffered || r->postponed) {
@ -1112,7 +1104,7 @@ index de1b2027..887cf6cd 100644
if (ngx_http_set_write_handler(r) != NGX_OK) {
ngx_http_terminate_request(r, 0);
}
@@ -2425,10 +2433,14 @@ ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc)
@@ -2538,10 +2547,14 @@ ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc)
pr->postponed = pr->postponed->next;
}
@ -1127,7 +1119,7 @@ index de1b2027..887cf6cd 100644
ngx_log_debug2(NGX_LOG_DEBUG_HTTP, c->log, 0,
"http finalize non-active request: \"%V?%V\"",
&r->uri, &r->args);
@@ -2440,6 +2452,8 @@ ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc)
@@ -2553,6 +2566,8 @@ ngx_http_finalize_request(ngx_http_request_t *r, ngx_int_t rc)
}
}

@ -1,11 +1,13 @@
--- nginx-1.17.4/src/http/ngx_http_request.c 2013-05-06 03:26:50.000000000 -0700
+++ nginx-1.17.4-patched/src/http/ngx_http_request.c 2013-06-11 12:59:48.008321688 -0700
@@ -1951,7 +1951,7 @@
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index 80c19656..f79b4a69 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -2153,7 +2156,7 @@ ngx_http_set_virtual_server(ngx_http_request_t *r, ngx_str_t *host)
ngx_int_t rc;
ngx_http_connection_t *hc;
ngx_http_core_loc_conf_t *clcf;
- ngx_http_core_srv_conf_t *cscf;
+ ngx_http_core_srv_conf_t *cscf = NULL;
hc = r->http_connection;
#if (NGX_SUPPRESS_WARN)
cscf = NULL;

@ -1,6 +1,7 @@
diff -rup nginx-1.17.4/src/core/nginx.c nginx-1.17.4-patched/src/core/nginx.c
--- nginx-1.17.4/src/core/nginx.c 2017-12-17 00:00:38.136470108 -0800
+++ nginx-1.17.4-patched/src/core/nginx.c 2017-12-16 23:59:51.680958322 -0800
diff --git a/src/core/nginx.c b/src/core/nginx.c
index 9fcb0eb2..3b75ce1a 100644
--- a/src/core/nginx.c
+++ b/src/core/nginx.c
@@ -186,6 +186,7 @@ static u_char *ngx_prefix;
static u_char *ngx_conf_file;
static u_char *ngx_conf_params;
@ -9,7 +10,7 @@ diff -rup nginx-1.17.4/src/core/nginx.c nginx-1.17.4-patched/src/core/nginx.c
static char **ngx_os_environ;
@@ -253,6 +254,8 @@ main(int argc, char *const *argv)
@@ -254,6 +255,8 @@ main(int argc, char *const *argv)
return 1;
}
@ -18,20 +19,22 @@ diff -rup nginx-1.17.4/src/core/nginx.c nginx-1.17.4-patched/src/core/nginx.c
if (ngx_save_argv(&init_cycle, argc, argv) != NGX_OK) {
return 1;
}
diff -rup nginx-1.17.4/src/core/ngx_core.h nginx-1.17.4-patched/src/core/ngx_core.h
--- nginx-1.17.4/src/core/ngx_core.h 2017-10-10 08:22:51.000000000 -0700
+++ nginx-1.17.4-patched/src/core/ngx_core.h 2017-12-16 23:59:51.679958370 -0800
@@ -108,4 +108,6 @@ void ngx_cpuinfo(void);
diff --git a/src/core/ngx_core.h b/src/core/ngx_core.h
index 93ca9174..b56480d9 100644
--- a/src/core/ngx_core.h
+++ b/src/core/ngx_core.h
@@ -109,4 +109,6 @@ void ngx_cpuinfo(void);
#define NGX_DISABLE_SYMLINKS_NOTOWNER 2
#endif
+extern ngx_pool_t *saved_init_cycle_pool;
+
#endif /* _NGX_CORE_H_INCLUDED_ */
diff -rup nginx-1.17.4/src/core/ngx_cycle.c nginx-1.17.4-patched/src/core/ngx_cycle.c
--- nginx-1.17.4/src/core/ngx_cycle.c 2017-10-10 08:22:51.000000000 -0700
+++ nginx-1.17.4-patched/src/core/ngx_cycle.c 2017-12-16 23:59:51.678958419 -0800
@@ -748,6 +748,10 @@ old_shm_zone_done:
diff --git a/src/core/ngx_cycle.c b/src/core/ngx_cycle.c
index 95f4bdfa..ce3200f8 100644
--- a/src/core/ngx_cycle.c
+++ b/src/core/ngx_cycle.c
@@ -758,6 +758,10 @@ old_shm_zone_done:
if (ngx_process == NGX_PROCESS_MASTER || ngx_is_init_cycle(old_cycle)) {
@ -42,10 +45,11 @@ diff -rup nginx-1.17.4/src/core/ngx_cycle.c nginx-1.17.4-patched/src/core/ngx_cy
ngx_destroy_pool(old_cycle->pool);
cycle->old_cycle = NULL;
diff -rup nginx-1.17.4/src/os/unix/ngx_process_cycle.c nginx-1.17.4-patched/src/os/unix/ngx_process_cycle.c
--- nginx-1.17.4/src/os/unix/ngx_process_cycle.c 2017-12-17 00:00:38.142469762 -0800
+++ nginx-1.17.4-patched/src/os/unix/ngx_process_cycle.c 2017-12-16 23:59:51.691957791 -0800
@@ -783,6 +783,11 @@ ngx_master_process_exit(ngx_cycle_t *cyc
diff --git a/src/os/unix/ngx_process_cycle.c b/src/os/unix/ngx_process_cycle.c
index 5817a2c2..aca73368 100644
--- a/src/os/unix/ngx_process_cycle.c
+++ b/src/os/unix/ngx_process_cycle.c
@@ -718,6 +718,11 @@ ngx_master_process_exit(ngx_cycle_t *cycle)
ngx_exit_cycle.files_n = ngx_cycle->files_n;
ngx_cycle = &ngx_exit_cycle;

@ -1,9 +1,9 @@
diff --git a/src/core/ngx_cycle.h b/src/core/ngx_cycle.h
index c51b7ff..4c335b9 100644
index 54fa2e6b..ce900173 100644
--- a/src/core/ngx_cycle.h
+++ b/src/core/ngx_cycle.h
@@ -22,9 +22,14 @@
#define NGX_DEBUG_POINTS_ABORT 2
@@ -25,9 +25,14 @@
#define HAVE_PRIVILEGED_PROCESS_PATCH 1
+#define HAVE_INTERCEPT_ERROR_LOG_PATCH
@ -17,7 +17,7 @@ index c51b7ff..4c335b9 100644
struct ngx_shm_zone_s {
void *data;
@@ -75,6 +80,10 @@ struct ngx_cycle_s {
@@ -84,6 +89,10 @@ struct ngx_cycle_s {
ngx_str_t prefix;
ngx_str_t lock_file;
ngx_str_t hostname;
@ -29,7 +29,7 @@ index c51b7ff..4c335b9 100644
diff --git a/src/core/ngx_log.c b/src/core/ngx_log.c
index 8e9408d..ed9b11b 100644
index 8e9408df..e498fc06 100644
--- a/src/core/ngx_log.c
+++ b/src/core/ngx_log.c
@@ -112,6 +112,8 @@ ngx_log_error_core(ngx_uint_t level, ngx_log_t *log, ngx_err_t err,

@ -1,8 +1,9 @@
diff -urp nginx-1.17.4/auto/cc/clang nginx-1.17.4-patched/auto/cc/clang
--- nginx-1.17.4/auto/cc/clang 2014-03-04 03:39:24.000000000 -0800
+++ nginx-1.17.4-patched/auto/cc/clang 2014-03-13 20:54:26.241413360 -0700
@@ -89,7 +89,7 @@ CFLAGS="$CFLAGS -Wconditional-uninitiali
CFLAGS="$CFLAGS -Wno-unused-parameter"
diff --git a/auto/cc/clang b/auto/cc/clang
index a962ee23..70a6ff15 100644
--- a/auto/cc/clang
+++ b/auto/cc/clang
@@ -89,7 +89,7 @@ if [ "$NGX_SYSTEM" = "Darwin" ]; then
fi
# stop on warning
-CFLAGS="$CFLAGS -Werror"
@ -10,10 +11,11 @@ diff -urp nginx-1.17.4/auto/cc/clang nginx-1.17.4-patched/auto/cc/clang
# debug
CFLAGS="$CFLAGS -g"
diff -urp nginx-1.17.4/auto/cc/gcc nginx-1.17.4-patched/auto/cc/gcc
--- nginx-1.17.4/auto/cc/gcc 2014-03-04 03:39:24.000000000 -0800
+++ nginx-1.17.4-patched/auto/cc/gcc 2014-03-13 20:54:13.301355329 -0700
@@ -168,7 +168,7 @@ esac
diff --git a/auto/cc/gcc b/auto/cc/gcc
index a5c5c18f..a5ca3369 100644
--- a/auto/cc/gcc
+++ b/auto/cc/gcc
@@ -166,7 +166,7 @@ esac
# stop on warning
@ -22,10 +24,11 @@ diff -urp nginx-1.17.4/auto/cc/gcc nginx-1.17.4-patched/auto/cc/gcc
# debug
CFLAGS="$CFLAGS -g"
diff -urp nginx-1.17.4/auto/cc/icc nginx-1.17.4-patched/auto/cc/icc
--- nginx-1.17.4/auto/cc/icc 2014-03-04 03:39:24.000000000 -0800
+++ nginx-1.17.4-patched/auto/cc/icc 2014-03-13 20:54:13.301355329 -0700
@@ -115,7 +115,7 @@ case "$NGX_ICC_VER" in
diff --git a/auto/cc/icc b/auto/cc/icc
index c47f6e4b..9b35e708 100644
--- a/auto/cc/icc
+++ b/auto/cc/icc
@@ -111,7 +111,7 @@ case "$NGX_ICC_VER" in
esac
# stop on warning

@ -1,8 +1,7 @@
diff --minimal '--exclude=*.swp' '--exclude=*~' -up nginx-1.17.4/src/core/nginx.h nginx-1.17.4-patched/src/core/nginx.h
--- nginx-1.17.4/src/core/nginx.h 2016-04-19 09:02:38.000000000 -0700
+++ nginx-1.17.4-patched/src/core/nginx.h 2016-04-21 16:25:07.452944624 -0700
@@ -10,7 +10,7 @@
diff --minimal '--exclude=*.swp' '--exclude=*~' -up nginx-1.17.4/src/core/nginx.h nginx-1.17.4/src/core/nginx.h
--- nginx-1.17.4/src/core/nginx.h
+++ nginx-1.17.4/src/core/nginx.h
@@ -11,7 +11,7 @@
#define nginx_version 1017004
#define NGINX_VERSION "1.17.4"
@ -10,9 +9,10 @@ diff --minimal '--exclude=*.swp' '--exclude=*~' -up nginx-1.17.4/src/core/nginx.
+#define NGINX_VER "openresty/" NGINX_VERSION ".unknown (no pool)"
#ifdef NGX_BUILD
diff --minimal '--exclude=*.swp' '--exclude=*~' -up nginx-1.17.4/src/core/ngx_array.c nginx-1.17.4-patched/src/core/ngx_array.c
--- nginx-1.17.4/src/core/ngx_array.c 2016-04-19 09:02:38.000000000 -0700
+++ nginx-1.17.4-patched/src/core/ngx_array.c 2016-04-21 16:25:07.453947190 -0700
#define NGINX_VER_BUILD NGINX_VER " (" NGX_BUILD ")"
diff --minimal '--exclude=*.swp' '--exclude=*~' -up nginx-1.17.4/src/core/ngx_array.c nginx-1.17.4/src/core/ngx_array.c
--- nginx-1.17.4/src/core/ngx_array.c
+++ nginx-1.17.4/src/core/ngx_array.c
@@ -30,26 +30,30 @@ ngx_array_create(ngx_pool_t *p, ngx_uint
void
ngx_array_destroy(ngx_array_t *a)
@ -160,9 +160,9 @@ diff --minimal '--exclude=*.swp' '--exclude=*~' -up nginx-1.17.4/src/core/ngx_ar
}
elt = (u_char *) a->elts + a->size * a->nelts;
diff --minimal '--exclude=*.swp' '--exclude=*~' -up nginx-1.17.4/src/core/ngx_array.h nginx-1.17.4-patched/src/core/ngx_array.h
--- nginx-1.17.4/src/core/ngx_array.h 2016-04-19 09:02:38.000000000 -0700
+++ nginx-1.17.4-patched/src/core/ngx_array.h 2016-04-21 16:25:07.453947190 -0700
diff --minimal '--exclude=*.swp' '--exclude=*~' -up nginx-1.17.4/src/core/ngx_array.h nginx-1.17.4/src/core/ngx_array.h
--- nginx-1.17.4/src/core/ngx_array.h
+++ nginx-1.17.4/src/core/ngx_array.h
@@ -13,12 +13,23 @@
#include <ngx_core.h>
@ -195,11 +195,11 @@ diff --minimal '--exclude=*.swp' '--exclude=*~' -up nginx-1.17.4/src/core/ngx_ar
array->elts = ngx_palloc(pool, n * size);
if (array->elts == NULL) {
diff --minimal '--exclude=*.swp' '--exclude=*~' -up nginx-1.17.4/src/core/ngx_palloc.c nginx-1.17.4-patched/src/core/ngx_palloc.c
--- nginx-1.17.4/src/core/ngx_palloc.c 2016-04-19 09:02:38.000000000 -0700
+++ nginx-1.17.4-patched/src/core/ngx_palloc.c 2016-04-21 16:25:45.912282685 -0700
@@ -9,34 +9,26 @@
#include <ngx_core.h>
diff --minimal '--exclude=*.swp' '--exclude=*~' -up nginx-1.17.4/src/core/ngx_palloc.c nginx-1.17.4/src/core/ngx_palloc.c
--- nginx-1.17.4/src/core/ngx_palloc.c
+++ nginx-1.17.4/src/core/ngx_palloc.c
@@ -10,34 +10,26 @@
#include <ngx_core_probe.h>
-static ngx_inline void *ngx_palloc_small(ngx_pool_t *pool, size_t size,
@ -237,8 +237,8 @@ diff --minimal '--exclude=*.swp' '--exclude=*~' -up nginx-1.17.4/src/core/ngx_pa
- p->cleanup = NULL;
p->log = log;
return p;
@@ -46,8 +38,7 @@ ngx_create_pool(size_t size, ngx_log_t *
ngx_core_probe_create_pool_done(p, size);
@@ -49,8 +41,7 @@ ngx_create_pool(size_t size, ngx_log_t *log)
void
ngx_destroy_pool(ngx_pool_t *pool)
{
@ -248,7 +248,7 @@ diff --minimal '--exclude=*.swp' '--exclude=*~' -up nginx-1.17.4/src/core/ngx_pa
ngx_pool_cleanup_t *c;
for (c = pool->cleanup; c; c = c->next) {
@@ -58,6 +49,11 @@ ngx_destroy_pool(ngx_pool_t *pool)
@@ -61,6 +52,11 @@ ngx_destroy_pool(ngx_pool_t *pool)
}
}
@ -260,7 +260,7 @@ diff --minimal '--exclude=*.swp' '--exclude=*~' -up nginx-1.17.4/src/core/ngx_pa
#if (NGX_DEBUG)
/*
@@ -65,13 +61,9 @@ ngx_destroy_pool(ngx_pool_t *pool)
@@ -68,13 +64,9 @@ ngx_destroy_pool(ngx_pool_t *pool)
* so we cannot use this log while free()ing the pool
*/
@ -276,7 +276,7 @@ diff --minimal '--exclude=*.swp' '--exclude=*~' -up nginx-1.17.4/src/core/ngx_pa
if (n == NULL) {
break;
@@ -80,171 +72,82 @@ ngx_destroy_pool(ngx_pool_t *pool)
@@ -83,171 +75,81 @@ ngx_destroy_pool(ngx_pool_t *pool)
#endif
@ -309,29 +309,29 @@ diff --minimal '--exclude=*.swp' '--exclude=*~' -up nginx-1.17.4/src/core/ngx_pa
- ngx_pool_large_t *l;
+ ngx_pool_data_t *d, *n;
+ ngx_pool_data_t *saved = NULL;
- for (l = pool->large; l; l = l->next) {
- if (l->alloc) {
- ngx_free(l->alloc);
+
+ if (pool->d) {
+ for (d = pool->d, n = d->next; ; d = n, n = n->next) {
+ if (d->alloc == pool->log) {
+ saved = d;
+ continue;
+ }
+
- for (l = pool->large; l; l = l->next) {
- if (l->alloc) {
- ngx_free(l->alloc);
- }
- }
+ ngx_free(d->alloc);
+ ngx_free(d);
+
+ if (n == NULL) {
+ break;
+ }
}
- }
- for (p = pool; p; p = p->d.next) {
- p->d.last = (u_char *) p + sizeof(ngx_pool_t);
- p->d.failed = 0;
+ if (n == NULL) {
+ break;
+ }
+ }
+ pool->d = saved;
+ pool->current = pool;
+ pool->chain = NULL;
@ -396,12 +396,14 @@ diff --minimal '--exclude=*.swp' '--exclude=*~' -up nginx-1.17.4/src/core/ngx_pa
- } while (p);
-
- return ngx_palloc_block(pool, size);
-}
-
-
-static void *
+ return ngx_malloc(pool, size);
}
static void *
-ngx_palloc_block(ngx_pool_t *pool, size_t size)
-{
+ngx_malloc(ngx_pool_t *pool, size_t size)
{
- u_char *m;
- size_t psize;
- ngx_pool_t *p, *new;
@ -432,14 +434,12 @@ diff --minimal '--exclude=*.swp' '--exclude=*~' -up nginx-1.17.4/src/core/ngx_pa
- p->d.next = new;
-
- return m;
+ return ngx_malloc(pool, size);
}
static void *
-}
-
-
-static void *
-ngx_palloc_large(ngx_pool_t *pool, size_t size)
+ngx_malloc(ngx_pool_t *pool, size_t size)
{
-{
- void *p;
- ngx_uint_t n;
- ngx_pool_large_t *large;
@ -467,7 +467,7 @@ diff --minimal '--exclude=*.swp' '--exclude=*~' -up nginx-1.17.4/src/core/ngx_pa
- large = ngx_palloc_small(pool, sizeof(ngx_pool_large_t), 1);
- if (large == NULL) {
+ d = ngx_alloc(sizeof(ngx_pool_data_t), pool->log);
+ if (d == NULL){
+ if (d == NULL) {
ngx_free(p);
return NULL;
}
@ -482,12 +482,12 @@ diff --minimal '--exclude=*.swp' '--exclude=*~' -up nginx-1.17.4/src/core/ngx_pa
return p;
}
@@ -253,38 +156,48 @@ void *
@@ -256,38 +158,48 @@ void *
ngx_pmemalign(ngx_pool_t *pool, size_t size, size_t alignment)
{
void *p;
- ngx_pool_large_t *large;
+ ngx_pool_data_t *d;
+ ngx_pool_large_t *d;
p = ngx_memalign(alignment, size, pool->log);
if (p == NULL) {
@ -497,7 +497,7 @@ diff --minimal '--exclude=*.swp' '--exclude=*~' -up nginx-1.17.4/src/core/ngx_pa
- large = ngx_palloc_small(pool, sizeof(ngx_pool_large_t), 1);
- if (large == NULL) {
+ d = ngx_alloc(sizeof(ngx_pool_data_t), pool->log);
+ if (d == NULL){
+ if (d == NULL) {
ngx_free(p);
return NULL;
}
@ -546,21 +546,24 @@ diff --minimal '--exclude=*.swp' '--exclude=*~' -up nginx-1.17.4/src/core/ngx_pa
return NGX_OK;
}
diff --minimal '--exclude=*.swp' '--exclude=*~' -up nginx-1.17.4/src/core/ngx_palloc.h nginx-1.17.4-patched/src/core/ngx_palloc.h
--- nginx-1.17.4/src/core/ngx_palloc.h 2016-04-19 09:02:38.000000000 -0700
+++ nginx-1.17.4-patched/src/core/ngx_palloc.h 2016-04-21 16:25:07.454949755 -0700
@@ -38,28 +38,21 @@ struct ngx_pool_cleanup_s {
diff --minimal '--exclude=*.swp' '--exclude=*~' -up nginx-1.17.4/src/core/ngx_palloc.h nginx-1.17.4/src/core/ngx_palloc.h
--- nginx-1.17.4/src/core/ngx_palloc.h
+++ nginx-1.17.4/src/core/ngx_palloc.h
@@ -38,28 +38,20 @@ struct ngx_pool_cleanup_s {
};
-typedef struct ngx_pool_large_s ngx_pool_large_t;
-
+typedef struct ngx_pool_data_s ngx_pool_large_t;
+typedef struct ngx_pool_data_s ngx_pool_data_t;
-struct ngx_pool_large_s {
- ngx_pool_large_t *next;
- void *alloc;
-};
+typedef struct ngx_pool_data_s ngx_pool_large_t;
+typedef struct ngx_pool_data_s ngx_pool_data_t;
+struct ngx_pool_data_s {
+ ngx_pool_data_t *next;
+ void *alloc;
};
-typedef struct {
@ -569,12 +572,8 @@ diff --minimal '--exclude=*.swp' '--exclude=*~' -up nginx-1.17.4/src/core/ngx_pa
- ngx_pool_t *next;
- ngx_uint_t failed;
-} ngx_pool_data_t;
+struct ngx_pool_data_s {
+ ngx_pool_data_t *next;
+ void *alloc;
+};
-
-
struct ngx_pool_s {
- ngx_pool_data_t d;
+ ngx_pool_data_t *d;

@ -5,10 +5,11 @@
# Parent 30e806b8636af5fd3f03ec17df24801f390f7511
Configure: added new option --with-pcre-conf-opt=OPTIONS.
diff -r 30e806b8636a -r 9ba6b149669f auto/options
--- a/auto/options Mon Dec 09 10:16:44 2013 +0400
+++ b/auto/options Tue Dec 10 09:02:35 2013 -0800
@@ -286,6 +286,7 @@
diff --git a/auto/options b/auto/options
index 521c9768..2feaa835 100644
--- a/auto/options
+++ b/auto/options
@@ -363,6 +363,7 @@ use the \"--with-mail_ssl_module\" option instead"
--with-pcre) USE_PCRE=YES ;;
--with-pcre=*) PCRE="$value" ;;
--with-pcre-opt=*) PCRE_OPT="$value" ;;
@ -16,11 +17,11 @@ diff -r 30e806b8636a -r 9ba6b149669f auto/options
--with-pcre-jit) PCRE_JIT=YES ;;
--with-openssl=*) OPENSSL="$value" ;;
@@ -441,6 +442,7 @@
@@ -580,6 +581,7 @@ cat << END
--with-pcre force PCRE library usage
--with-pcre=DIR set path to PCRE library sources
--with-pcre-opt=OPTIONS set additional build options for PCRE
+ --with-pcre-conf-opt=OPTIONS set additional configure options for PCRE
--with-pcre-jit build PCRE with JIT compilation support
--with-md5=DIR set path to md5 library sources
--with-zlib=DIR set path to zlib library sources

@ -1,25 +1,25 @@
diff --git a/src/core/nginx.c b/src/core/nginx.c
index 60f8fe7..4bd244b 100644
index 9fcb0eb2..cba4ca55 100644
--- a/src/core/nginx.c
+++ b/src/core/nginx.c
@@ -981,6 +981,7 @@ ngx_core_module_create_conf(ngx_cycle_t *cycle)
@@ -1027,6 +1030,7 @@ ngx_core_module_create_conf(ngx_cycle_t *cycle)
ccf->daemon = NGX_CONF_UNSET;
ccf->master = NGX_CONF_UNSET;
+ ccf->privileged_agent = NGX_CONF_UNSET;
ccf->timer_resolution = NGX_CONF_UNSET_MSEC;
ccf->shutdown_timeout = NGX_CONF_UNSET_MSEC;
ccf->worker_processes = NGX_CONF_UNSET;
@@ -1009,6 +1010,7 @@ ngx_core_module_init_conf(ngx_cycle_t *cycle, void *conf)
@@ -1056,6 +1060,7 @@ ngx_core_module_init_conf(ngx_cycle_t *cycle, void *conf)
ngx_conf_init_value(ccf->daemon, 1);
ngx_conf_init_value(ccf->master, 1);
+ ngx_conf_init_value(ccf->privileged_agent, 0);
ngx_conf_init_msec_value(ccf->timer_resolution, 0);
ngx_conf_init_msec_value(ccf->shutdown_timeout, 0);
ngx_conf_init_value(ccf->worker_processes, 1);
diff --git a/src/core/ngx_cycle.h b/src/core/ngx_cycle.h
index c51b7ff..3261f90 100644
index 54fa2e6b..c3b0181c 100644
--- a/src/core/ngx_cycle.h
+++ b/src/core/ngx_cycle.h
@@ -22,6 +22,9 @@
@ -32,16 +32,16 @@ index c51b7ff..3261f90 100644
typedef struct ngx_shm_zone_s ngx_shm_zone_t;
typedef ngx_int_t (*ngx_shm_zone_init_pt) (ngx_shm_zone_t *zone, void *data);
@@ -81,6 +84,7 @@ struct ngx_cycle_s {
@@ -87,6 +90,7 @@ struct ngx_cycle_s {
typedef struct {
ngx_flag_t daemon;
ngx_flag_t master;
+ ngx_flag_t privileged_agent;
ngx_msec_t timer_resolution;
ngx_msec_t shutdown_timeout;
diff --git a/src/os/unix/ngx_process_cycle.c b/src/os/unix/ngx_process_cycle.c
index 7cee1c5..c4f70d6 100644
index 5817a2c2..4cd00e9b 100644
--- a/src/os/unix/ngx_process_cycle.c
+++ b/src/os/unix/ngx_process_cycle.c
@@ -15,6 +15,8 @@ static void ngx_start_worker_processes(ngx_cycle_t *cycle, ngx_int_t n,
@ -61,7 +61,7 @@ index 7cee1c5..c4f70d6 100644
static void ngx_cache_manager_process_handler(ngx_event_t *ev);
static void ngx_cache_loader_process_handler(ngx_event_t *ev);
@@ -51,6 +54,8 @@ sig_atomic_t ngx_noaccept;
@@ -52,6 +55,8 @@ sig_atomic_t ngx_noaccept;
ngx_uint_t ngx_noaccepting;
ngx_uint_t ngx_restart;
@ -70,7 +70,7 @@ index 7cee1c5..c4f70d6 100644
static u_char master_process[] = "master process";
@@ -130,6 +135,7 @@ ngx_master_process_cycle(ngx_cycle_t *cycle)
@@ -131,6 +136,7 @@ ngx_master_process_cycle(ngx_cycle_t *cycle)
ngx_start_worker_processes(cycle, ccf->worker_processes,
NGX_PROCESS_RESPAWN);
ngx_start_cache_manager_processes(cycle, 0);
@ -78,7 +78,7 @@ index 7cee1c5..c4f70d6 100644
ngx_new_binary = 0;
delay = 0;
@@ -224,6 +230,7 @@ ngx_master_process_cycle(ngx_cycle_t *cycle)
@@ -225,6 +231,7 @@ ngx_master_process_cycle(ngx_cycle_t *cycle)
ngx_start_worker_processes(cycle, ccf->worker_processes,
NGX_PROCESS_RESPAWN);
ngx_start_cache_manager_processes(cycle, 0);
@ -86,7 +86,7 @@ index 7cee1c5..c4f70d6 100644
ngx_noaccepting = 0;
continue;
@@ -243,6 +250,7 @@ ngx_master_process_cycle(ngx_cycle_t *cycle)
@@ -244,6 +251,7 @@ ngx_master_process_cycle(ngx_cycle_t *cycle)
ngx_start_worker_processes(cycle, ccf->worker_processes,
NGX_PROCESS_JUST_RESPAWN);
ngx_start_cache_manager_processes(cycle, 1);
@ -94,7 +94,7 @@ index 7cee1c5..c4f70d6 100644
/* allow new processes to start */
ngx_msleep(100);
@@ -257,6 +265,7 @@ ngx_master_process_cycle(ngx_cycle_t *cycle)
@@ -258,6 +266,7 @@ ngx_master_process_cycle(ngx_cycle_t *cycle)
ngx_start_worker_processes(cycle, ccf->worker_processes,
NGX_PROCESS_RESPAWN);
ngx_start_cache_manager_processes(cycle, 0);
@ -137,7 +137,7 @@ index 7cee1c5..c4f70d6 100644
ngx_pass_open_channel(ngx_cycle_t *cycle, ngx_channel_t *ch)
{
ngx_int_t i;
@@ -827,7 +864,10 @@ ngx_worker_process_init(ngx_cycle_t *cycle, ngx_int_t worker)
@@ -825,7 +867,10 @@ ngx_worker_process_init(ngx_cycle_t *cycle, ngx_int_t worker)
}
}
@ -149,10 +149,11 @@ index 7cee1c5..c4f70d6 100644
if (setgid(ccf->group) == -1) {
ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno,
"setgid(%d) failed", ccf->group);
@@ -1144,6 +1184,47 @@ ngx_cache_manager_process_cycle(ngx_cycle_t *cycle, void *data)
@@ -1174,6 +1219,47 @@ ngx_cache_manager_process_cycle(ngx_cycle_t *cycle, void *data)
}
static void
+static void
+ngx_privileged_agent_process_cycle(ngx_cycle_t *cycle, void *data)
+{
+ char *name = data;
@ -193,12 +194,11 @@ index 7cee1c5..c4f70d6 100644
+}
+
+
+static void
static void
ngx_cache_manager_process_handler(ngx_event_t *ev)
{
time_t next, n;
diff --git a/src/os/unix/ngx_process_cycle.h b/src/os/unix/ngx_process_cycle.h
index 69495d5..5149396 100644
index 69495d5f..51493962 100644
--- a/src/os/unix/ngx_process_cycle.h
+++ b/src/os/unix/ngx_process_cycle.h
@@ -45,6 +45,7 @@ extern ngx_pid_t ngx_new_binary;

@ -1,5 +1,5 @@
diff --git a/src/core/ngx_resolver.c b/src/core/ngx_resolver.c
index cd55520c..dade1846 100644
index e51712c0..2a8f3942 100644
--- a/src/core/ngx_resolver.c
+++ b/src/core/ngx_resolver.c
@@ -9,12 +9,26 @@
@ -221,7 +221,7 @@ index cd55520c..dade1846 100644
ngx_resolver_t *
ngx_resolver_create(ngx_conf_t *cf, ngx_str_t *names, ngx_uint_t n)
{
@@ -246,6 +445,39 @@ ngx_resolver_create(ngx_conf_t *cf, ngx_str_t *names, ngx_uint_t n)
@@ -245,6 +444,39 @@ ngx_resolver_create(ngx_conf_t *cf, ngx_str_t *names, ngx_uint_t n)
}
#endif

@ -19,10 +19,10 @@ to assume "ipv6=off" to be safe regardless of ipv6 support in the current
build.
diff --git a/src/core/ngx_resolver.c b/src/core/ngx_resolver.c
index dade1846..5a3f0aa4 100644
index e51712c0..b526725b 100644
--- a/src/core/ngx_resolver.c
+++ b/src/core/ngx_resolver.c
@@ -426,14 +426,22 @@ ngx_resolver_create(ngx_conf_t *cf, ngx_str_t *names, ngx_uint_t n)
@@ -425,14 +425,22 @@ ngx_resolver_create(ngx_conf_t *cf, ngx_str_t *names, ngx_uint_t n)
continue;
}
@ -46,7 +46,7 @@ index dade1846..5a3f0aa4 100644
} else {
ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
@@ -443,7 +451,6 @@ ngx_resolver_create(ngx_conf_t *cf, ngx_str_t *names, ngx_uint_t n)
@@ -442,7 +450,6 @@ ngx_resolver_create(ngx_conf_t *cf, ngx_str_t *names, ngx_uint_t n)
continue;
}

@ -1,5 +1,5 @@
diff --git a/src/core/nginx.h b/src/core/nginx.h
index a3c0ef8..1263881 100644
index 0ebc50af..d17de58a 100644
--- a/src/core/nginx.h
+++ b/src/core/nginx.h
@@ -11,7 +11,7 @@
@ -12,7 +12,7 @@ index a3c0ef8..1263881 100644
#ifdef NGX_BUILD
#define NGINX_VER_BUILD NGINX_VER " (" NGX_BUILD ")"
diff --git a/src/http/ngx_http_header_filter_module.c b/src/http/ngx_http_header_filter_module.c
index 9b89405..ca13f2a 100644
index 9b894059..ca13f2a3 100644
--- a/src/http/ngx_http_header_filter_module.c
+++ b/src/http/ngx_http_header_filter_module.c
@@ -46,7 +46,7 @@ ngx_module_t ngx_http_header_filter_module = {
@ -25,10 +25,10 @@ index 9b89405..ca13f2a 100644
static u_char ngx_http_server_build_string[] = "Server: " NGINX_VER_BUILD CRLF;
diff --git a/src/http/v2/ngx_http_v2_filter_module.c b/src/http/v2/ngx_http_v2_filter_module.c
index 8621e7a..a76c677 100644
index a6e5e7d4..3b9a5bd7 100644
--- a/src/http/v2/ngx_http_v2_filter_module.c
+++ b/src/http/v2/ngx_http_v2_filter_module.c
@@ -143,7 +143,7 @@ ngx_http_v2_header_filter(ngx_http_request_t *r)
@@ -148,7 +148,7 @@ ngx_http_v2_header_filter(ngx_http_request_t *r)
ngx_http_core_srv_conf_t *cscf;
u_char addr[NGX_SOCKADDR_STRLEN];

@ -1,8 +1,8 @@
diff --git a/src/os/unix/ngx_process_cycle.c b/src/os/unix/ngx_process_cycle.c
index 1710ea81..b379da9c 100644
index 5817a2c2..8e860b07 100644
--- a/src/os/unix/ngx_process_cycle.c
+++ b/src/os/unix/ngx_process_cycle.c
@@ -304,11 +304,26 @@ ngx_single_process_cycle(ngx_cycle_t *cycle)
@@ -305,11 +314,26 @@ ngx_single_process_cycle(ngx_cycle_t *cycle)
}
for ( ;; ) {
@ -30,7 +30,7 @@ index 1710ea81..b379da9c 100644
for (i = 0; cycle->modules[i]; i++) {
if (cycle->modules[i]->exit_process) {
@@ -319,6 +334,20 @@ ngx_single_process_cycle(ngx_cycle_t *cycle)
@@ -320,6 +344,20 @@ ngx_single_process_cycle(ngx_cycle_t *cycle)
ngx_master_process_exit(cycle);
}

@ -13,10 +13,11 @@ Here we added support for such usage in NGINX 3rd-party modules
(like ngx_lua) in NGINX's event handlers for downstream SSL
connections.
diff -r 78b4e10b4367 -r 449f0461859c src/event/ngx_event_openssl.c
--- a/src/event/ngx_event_openssl.c Thu Dec 17 16:39:15 2015 +0300
+++ b/src/event/ngx_event_openssl.c Sat Jan 02 11:14:44 2016 -0800
@@ -1445,6 +1445,23 @@ ngx_ssl_handshake(ngx_connection_t *c)
diff --git a/src/event/ngx_event_openssl.c b/src/event/ngx_event_openssl.c
index 3737839d..70bbcedb 100644
--- a/src/event/ngx_event_openssl.c
+++ b/src/event/ngx_event_openssl.c
@@ -1680,6 +1680,23 @@ ngx_ssl_handshake(ngx_connection_t *c)
return NGX_AGAIN;
}
@ -40,7 +41,7 @@ diff -r 78b4e10b4367 -r 449f0461859c src/event/ngx_event_openssl.c
err = (sslerr == SSL_ERROR_SYSCALL) ? ngx_errno : 0;
c->ssl->no_wait_shutdown = 1;
@@ -1558,6 +1575,21 @@ ngx_ssl_try_early_data(ngx_connection_t *c)
@@ -1777,6 +1794,21 @@ ngx_ssl_try_early_data(ngx_connection_t *c)
return NGX_AGAIN;
}

@ -1,7 +1,8 @@
diff --git a/src/event/ngx_event_openssl.c b/src/event/ngx_event_openssl.c
index 3737839d..70bbcedb 100644
--- a/src/event/ngx_event_openssl.c
+++ b/src/event/ngx_event_openssl.c
@@ -1446,7 +1446,12 @@ ngx_ssl_handshake(ngx_connection_t *c)
@@ -1681,7 +1681,12 @@ ngx_ssl_handshake(ngx_connection_t *c)
}
#if OPENSSL_VERSION_NUMBER >= 0x10002000L
@ -15,7 +16,7 @@ diff --git a/src/event/ngx_event_openssl.c b/src/event/ngx_event_openssl.c
c->read->handler = ngx_ssl_handshake_handler;
c->write->handler = ngx_ssl_handshake_handler;
@@ -1575,6 +1580,23 @@ ngx_ssl_try_early_data(ngx_connection_t *c)
@@ -1825,6 +1830,23 @@ ngx_ssl_try_early_data(ngx_connection_t *c)
return NGX_AGAIN;
}

@ -1,5 +1,5 @@
diff --git a/src/stream/ngx_stream_upstream_round_robin.c b/src/stream/ngx_stream_upstream_round_robin.c
index 526de3a..b531ce1 100644
index c207667..7e02c0f 100644
--- a/src/stream/ngx_stream_upstream_round_robin.c
+++ b/src/stream/ngx_stream_upstream_round_robin.c
@@ -21,10 +21,6 @@ static void ngx_stream_upstream_notify_round_robin_peer(
@ -22,7 +22,7 @@ index 526de3a..b531ce1 100644
ngx_stream_upstream_set_round_robin_peer_session(ngx_peer_connection_t *pc,
void *data)
{
@@ -756,7 +752,7 @@ ngx_stream_upstream_set_round_robin_peer_session(ngx_peer_connection_t *pc,
@@ -753,7 +749,7 @@ ngx_stream_upstream_set_round_robin_peer_session(ngx_peer_connection_t *pc,
}

@ -1,8 +1,8 @@
diff --git a/src/stream/ngx_stream.h b/src/stream/ngx_stream.h
index 09d2459..de92724 100644
index 57e73e04..85c8678f 100644
--- a/src/stream/ngx_stream.h
+++ b/src/stream/ngx_stream.h
@@ -303,4 +303,7 @@ typedef ngx_int_t (*ngx_stream_filter_pt)(ngx_stream_session_t *s,
@@ -304,4 +304,7 @@ typedef ngx_int_t (*ngx_stream_filter_pt)(ngx_stream_session_t *s,
extern ngx_stream_filter_pt ngx_stream_top_filter;
@ -11,10 +11,10 @@ index 09d2459..de92724 100644
+
#endif /* _NGX_STREAM_H_INCLUDED_ */
diff --git a/src/stream/ngx_stream_proxy_module.c b/src/stream/ngx_stream_proxy_module.c
index 0afde1c..3254ce1 100644
index 7484a728..3d5bb3e4 100644
--- a/src/stream/ngx_stream_proxy_module.c
+++ b/src/stream/ngx_stream_proxy_module.c
@@ -2156,3 +2156,14 @@ ngx_stream_proxy_bind(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
@@ -2315,3 +2315,14 @@ ngx_stream_proxy_bind(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
return NGX_CONF_OK;
}

@ -1,5 +1,5 @@
diff --git a/src/stream/ngx_stream.h b/src/stream/ngx_stream.h
index 57e73e04..9a95ef99 100644
index 57e73e04..e87d0215 100644
--- a/src/stream/ngx_stream.h
+++ b/src/stream/ngx_stream.h
@@ -242,6 +242,15 @@ typedef struct {
@ -27,7 +27,7 @@ index 57e73e04..9a95ef99 100644
typedef ngx_int_t (*ngx_stream_filter_pt)(ngx_stream_session_t *s,
diff --git a/src/stream/ngx_stream_proxy_module.c b/src/stream/ngx_stream_proxy_module.c
index 7484a728..7b50b427 100644
index 7484a728..e9da1898 100644
--- a/src/stream/ngx_stream_proxy_module.c
+++ b/src/stream/ngx_stream_proxy_module.c
@@ -378,6 +378,7 @@ ngx_stream_proxy_handler(ngx_stream_session_t *s)

@ -1,10 +1,10 @@
diff --git a/src/stream/ngx_stream_ssl_preread_module.c b/src/stream/ngx_stream_ssl_preread_module.c
index e3d11fd9..3717b5fe 100644
index a236fc55..df2eadc5 100644
--- a/src/stream/ngx_stream_ssl_preread_module.c
+++ b/src/stream/ngx_stream_ssl_preread_module.c
@@ -159,7 +159,7 @@ ngx_stream_ssl_preread_handler(ngx_stream_session_t *s)
@@ -188,7 +188,7 @@ ngx_stream_ssl_preread_handler(ngx_stream_session_t *s)
}
rc = ngx_stream_ssl_preread_parse_record(ctx, p, p + len);
if (rc != NGX_AGAIN) {
- return rc;
+ return rc == NGX_OK ? NGX_DECLINED : rc;

@ -146,7 +146,7 @@ echo
echo "$info_txt applying the server_header patch for nginx"
cp $root/patches/nginx-$main_ver-server_header.patch server_header.patch || exit 1
sed $"s/NGINX_VERSION \".unknown\"/NGINX_VERSION \".$minor_ver\"/" server_header.patch \
sed "s/NGINX_VERSION \".unknown\"/NGINX_VERSION \".$minor_ver\"/" server_header.patch \
> server_header.patch.tmp && mv -f server_header.patch.tmp server_header.patch || exit 1
patch -p1 < server_header.patch || exit 1
echo
@ -455,7 +455,7 @@ patch -p1 < $root/patches/nginx-$main_ver-always_enable_cc_feature_tests.patch
echo
echo "$info_txt applying the ssl_cert_cb_yield.patch patch to nginx"
patch -p1 < $root/patches/nginx-$main_ver-ssl_cert_cb_yield.patch
patch -p1 < $root/patches/nginx-$main_ver-ssl_cert_cb_yield.patch || exit 1
echo
answer=`$root/util/ver-ge "$main_ver" 1.17.1`
@ -465,7 +465,7 @@ if [ "$answer" = "N" ]; then
echo
else
echo "$info_txt applying the ssl_sess_cb_yield.patch patch to nginx"
patch -p1 < $root/patches/nginx-$main_ver-ssl_sess_cb_yield.patch
patch -p1 < $root/patches/nginx-$main_ver-ssl_sess_cb_yield.patch || exit 1
echo
fi
@ -491,7 +491,7 @@ cp $root/html/50x.html docs/html/ || exit 1
cd .. || exit 1
cp $root/patches/nginx-$main_ver-no_pool.patch ./nginx-no_pool.patch || exit 1
sed $"s/NGINX_VERSION \".unknown/NGINX_VERSION \".$minor_ver/" \
sed "s/NGINX_VERSION \".unknown/NGINX_VERSION \".$minor_ver/g" \
./nginx-no_pool.patch > ./nginx-no_pool.patch.tmp && \
mv ./nginx-no_pool.patch.tmp ./nginx-no_pool.patch \
|| exit 1
@ -876,8 +876,8 @@ cd ..
#################################
rm *.tar.gz
rm *.tar.bz2
rm -f *.tar.gz
rm -f *.tar.bz2
cd ..
cp $root/util/configure ./ || exit 1

Loading…
Cancel
Save