|
|
|
@ -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;
|
|
|
|
|