nginx-0.1.19-RELEASE import
*) Bugfix: now, if request contains the zero, then the 404 error is
returned for the local requests.
*) Bugfix: nginx could not be built on NetBSD 2.0.
*) Bugfix: the timeout may occur while reading of the the client
request body via SSL connections.
diff --git a/src/core/nginx.h b/src/core/nginx.h
index dbadb45..071cf1c 100644
--- a/src/core/nginx.h
+++ b/src/core/nginx.h
@@ -8,7 +8,7 @@
#define _NGINX_H_INCLUDED_
-#define NGINX_VER "nginx/0.1.18"
+#define NGINX_VER "nginx/0.1.19"
#define NGINX_VAR "NGINX"
#define NGX_NEWPID_EXT ".newbin"
diff --git a/src/core/ngx_radix_tree.c b/src/core/ngx_radix_tree.c
index e0ce095..fa056af 100644
--- a/src/core/ngx_radix_tree.c
+++ b/src/core/ngx_radix_tree.c
@@ -12,7 +12,7 @@
ngx_radix_tree_t *
-ngx_radix_tree_create(ngx_pool_t *pool, ngx_uint_t preallocate)
+ngx_radix_tree_create(ngx_pool_t *pool, ngx_int_t preallocate)
{
uint32_t key, mask, inc;
ngx_radix_tree_t *tree;
@@ -35,13 +35,46 @@
tree->root->parent = NULL;
tree->root->value = NGX_RADIX_NO_VALUE;
+ if (preallocate == 0) {
+ return tree;
+ }
+
/*
* We preallocate the first nodes: 0, 1, 00, 01, 10, 11, 000, 001, etc.,
* to increase the TLB hits even if for the first lookup iterations.
* On the 32-bit platforms the 7 preallocated bits takes continuous 4K,
- * 8 - 8K, 9 - 16K, etc.
+ * 8 - 8K, 9 - 16K, etc. On the 64-bit platforms the 6 preallocated bits
+ * takes continuous 4K, 7 - 8K, 8 - 16K, etc. There is no sense to
+ * to preallocate more than one page, because further preallocation
+ * distribute the only bit per page. Instead, the random insertion
+ * may distribute several bits per page.
+ *
+ * Thus, by default we preallocate maximum
+ * 6 bits on amd64 (64-bit platform and 4K pages)
+ * 7 bits on i386 (32-bit platform and 4K pages)
+ * 7 bits on sparc64 in 64-bit mode (8K pages)
+ * 8 bits on sparc64 in 32-bit mode (8K pages)
*/
+ if (preallocate == -1) {
+ switch (ngx_pagesize / sizeof(ngx_radix_tree_t)) {
+
+ /* amd64 */
+ case 128:
+ preallocate = 6;
+ break;
+
+ /* i386, sparc64 */
+ case 256:
+ preallocate = 7;
+ break;
+
+ /* sparc64 in 32-bit mode */
+ default:
+ preallocate = 8;
+ }
+ }
+
mask = 0;
inc = 0x80000000;
diff --git a/src/core/ngx_radix_tree.h b/src/core/ngx_radix_tree.h
index 99c6eea..02a9f38 100644
--- a/src/core/ngx_radix_tree.h
+++ b/src/core/ngx_radix_tree.h
@@ -34,7 +34,7 @@
ngx_radix_tree_t *ngx_radix_tree_create(ngx_pool_t *pool,
- ngx_uint_t preallocate);
+ ngx_int_t preallocate);
ngx_int_t ngx_radix32tree_insert(ngx_radix_tree_t *tree,
uint32_t key, uint32_t mask, uintptr_t value);
ngx_int_t ngx_radix32tree_delete(ngx_radix_tree_t *tree,
diff --git a/src/core/ngx_times.c b/src/core/ngx_times.c
index 234a8ae..9354232 100644
--- a/src/core/ngx_times.c
+++ b/src/core/ngx_times.c
@@ -308,7 +308,6 @@
mday -= 28;
}
}
-
/*
* there is no "yday" in Win32 SYSTEMTIME
*
@@ -316,7 +315,7 @@
* yday += 31 + 28;
*
* if ((year % 4 == 0) && (year % 100 || (year % 400 == 0))) {
- * yday++;
+ * yday++;
* }
*/
}