[nginx] Core: fixed hash to actually try max_size.

Maxim Dounin mdounin at mdounin.ru
Tue Apr 1 13:50:11 UTC 2014


details:   http://hg.nginx.org/nginx/rev/54f847c88cf7
branches:  
changeset: 5636:54f847c88cf7
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Mon Mar 31 21:40:35 2014 +0400
description:
Core: fixed hash to actually try max_size.

Previously, maximum size of a hash table built was (max_size - 1).

diffstat:

 src/core/ngx_hash.c |  2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diffs (12 lines):

diff --git a/src/core/ngx_hash.c b/src/core/ngx_hash.c
--- a/src/core/ngx_hash.c
+++ b/src/core/ngx_hash.c
@@ -282,7 +282,7 @@ ngx_hash_init(ngx_hash_init_t *hinit, ng
         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));
 



More information about the nginx-devel mailing list