summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/nginx.h4
-rw-r--r--src/core/ngx_hash.c15
-rw-r--r--src/core/ngx_slab.c6
-rw-r--r--src/core/ngx_slab.h2
4 files changed, 15 insertions, 12 deletions
diff --git a/src/core/nginx.h b/src/core/nginx.h
index 17dda595e..dc88100b9 100644
--- a/src/core/nginx.h
+++ b/src/core/nginx.h
@@ -9,8 +9,8 @@
#define _NGINX_H_INCLUDED_
-#define nginx_version 1005012
-#define NGINX_VERSION "1.5.12"
+#define nginx_version 1005013
+#define NGINX_VERSION "1.5.13"
#define NGINX_VER "nginx/" NGINX_VERSION
#define NGINX_VAR "NGINX"
diff --git a/src/core/ngx_hash.c b/src/core/ngx_hash.c
index b53294502..c7bfed709 100644
--- a/src/core/ngx_hash.c
+++ b/src/core/ngx_hash.c
@@ -282,7 +282,7 @@ ngx_hash_init(ngx_hash_init_t *hinit, ngx_hash_key_t *names, ngx_uint_t nelts)
start = hinit->max_size - 1000;
}
- for (size = start; size < hinit->max_size; size++) {
+ for (size = start; size <= hinit->max_size; size++) {
ngx_memzero(test, size * sizeof(u_short));
@@ -312,15 +312,12 @@ ngx_hash_init(ngx_hash_init_t *hinit, ngx_hash_key_t *names, ngx_uint_t nelts)
continue;
}
- ngx_log_error(NGX_LOG_EMERG, hinit->pool->log, 0,
- "could not build the %s, you should increase "
- "either %s_max_size: %i or %s_bucket_size: %i",
+ ngx_log_error(NGX_LOG_WARN, hinit->pool->log, 0,
+ "could not build optimal %s, you should increase "
+ "either %s_max_size: %i or %s_bucket_size: %i; "
+ "ignoring %s_bucket_size",
hinit->name, hinit->name, hinit->max_size,
- hinit->name, hinit->bucket_size);
-
- ngx_free(test);
-
- return NGX_ERROR;
+ hinit->name, hinit->bucket_size, hinit->name);
found:
diff --git a/src/core/ngx_slab.c b/src/core/ngx_slab.c
index 6d18abb72..be7927ce0 100644
--- a/src/core/ngx_slab.c
+++ b/src/core/ngx_slab.c
@@ -129,6 +129,7 @@ ngx_slab_init(ngx_slab_pool_t *pool)
pool->pages->slab = pages;
}
+ pool->log_nomem = 1;
pool->log_ctx = &pool->zero;
pool->zero = '\0';
}
@@ -658,7 +659,10 @@ ngx_slab_alloc_pages(ngx_slab_pool_t *pool, ngx_uint_t pages)
}
}
- ngx_slab_error(pool, NGX_LOG_CRIT, "ngx_slab_alloc() failed: no memory");
+ if (pool->log_nomem) {
+ ngx_slab_error(pool, NGX_LOG_CRIT,
+ "ngx_slab_alloc() failed: no memory");
+ }
return NULL;
}
diff --git a/src/core/ngx_slab.h b/src/core/ngx_slab.h
index c5e420bfa..5735e3bb3 100644
--- a/src/core/ngx_slab.h
+++ b/src/core/ngx_slab.h
@@ -39,6 +39,8 @@ typedef struct {
u_char *log_ctx;
u_char zero;
+ unsigned log_nomem:1;
+
void *data;
void *addr;
} ngx_slab_pool_t;