Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2005-12-28 17:23:52 +0300
committerIgor Sysoev <igor@sysoev.ru>2005-12-28 17:23:52 +0300
commit3ca233ee5cc0e00fc0d854f779ba5c78cf6b0cba (patch)
tree082164b43d8c98923c587524bddf19fdab2e13f0 /src/core
parentb0b4973576eead9175faa089e66bdc33b698941d (diff)
nginx-0.3.19-RELEASE importrelease-0.3.19
*) Feature: the "path" and "alias" directives support the variables. *) Change: now the "valid_referers" directive again checks the URI part. *) Bugfix: in SSI handling.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/nginx.h2
-rw-r--r--src/core/ngx_buf.h5
-rw-r--r--src/core/ngx_hash.c23
3 files changed, 18 insertions, 12 deletions
diff --git a/src/core/nginx.h b/src/core/nginx.h
index 511a7c9fb..a15f58e1a 100644
--- a/src/core/nginx.h
+++ b/src/core/nginx.h
@@ -8,7 +8,7 @@
#define _NGINX_H_INCLUDED_
-#define NGINX_VER "nginx/0.3.18"
+#define NGINX_VER "nginx/0.3.19"
#define NGINX_VAR "NGINX"
#define NGX_OLDPID_EXT ".oldbin"
diff --git a/src/core/ngx_buf.h b/src/core/ngx_buf.h
index 625db2a93..ec55ef3a0 100644
--- a/src/core/ngx_buf.h
+++ b/src/core/ngx_buf.h
@@ -105,10 +105,15 @@ typedef struct {
#define ngx_buf_in_memory(b) (b->temporary || b->memory || b->mmap)
#define ngx_buf_in_memory_only(b) (ngx_buf_in_memory(b) && !b->in_file)
+
#define ngx_buf_special(b) \
((b->flush || b->last_buf || b->sync) \
&& !ngx_buf_in_memory(b) && !b->in_file)
+#define ngx_buf_sync_only(b) \
+ (b->sync \
+ && !ngx_buf_in_memory(b) && !b->in_file && !b->flush && !b->last_buf)
+
#define ngx_buf_size(b) \
(ngx_buf_in_memory(b) ? (off_t) (b->last - b->pos): \
(b->file_last - b->file_pos))
diff --git a/src/core/ngx_hash.c b/src/core/ngx_hash.c
index f43d67533..0a1d69d9b 100644
--- a/src/core/ngx_hash.c
+++ b/src/core/ngx_hash.c
@@ -129,13 +129,14 @@ ngx_hash_find_wildcard(ngx_hash_wildcard_t *hwc, u_char *name, size_t len)
#define NGX_HASH_ELT_SIZE(name) \
- sizeof(void *) + ngx_align((name)->key.len + 1, sizeof(void *))
+ (sizeof(void *) + ngx_align((name)->key.len + 1, sizeof(void *)))
ngx_int_t
ngx_hash_init(ngx_hash_init_t *hinit, ngx_hash_key_t *names, ngx_uint_t nelts)
{
u_char *elts;
- size_t *test, len;
+ size_t len;
+ u_short *test;
ngx_uint_t i, n, key, size, start, bucket_size;
ngx_hash_elt_t *elt, **buckets;
@@ -151,14 +152,14 @@ ngx_hash_init(ngx_hash_init_t *hinit, ngx_hash_key_t *names, ngx_uint_t nelts)
if (hinit->bucket_size < NGX_HASH_ELT_SIZE(&names[n]) + sizeof(void *))
{
ngx_log_error(NGX_LOG_EMERG, hinit->pool->log, 0,
- "could not build the %s hash, you should "
+ "could not build the %s, you should "
"increase %s_bucket_size: %i",
hinit->name, hinit->name, hinit->bucket_size);
return NGX_ERROR;
}
}
- test = ngx_alloc(hinit->max_size * sizeof(size_t), hinit->pool->log);
+ test = ngx_alloc(hinit->max_size * sizeof(u_short), hinit->pool->log);
if (test == NULL) {
return NGX_ERROR;
}
@@ -170,7 +171,7 @@ ngx_hash_init(ngx_hash_init_t *hinit, ngx_hash_key_t *names, ngx_uint_t nelts)
for (size = start; size < hinit->max_size; size++) {
- ngx_memzero(test, size * sizeof(size_t));
+ ngx_memzero(test, size * sizeof(u_short));
for (n = 0; n < nelts; n++) {
if (names[n].key.data == NULL) {
@@ -178,7 +179,7 @@ ngx_hash_init(ngx_hash_init_t *hinit, ngx_hash_key_t *names, ngx_uint_t nelts)
}
key = names[n].key_hash % size;
- test[key] += NGX_HASH_ELT_SIZE(&names[n]);
+ test[key] = (u_short) (test[key] + NGX_HASH_ELT_SIZE(&names[n]));
#if 0
ngx_log_error(NGX_LOG_ALERT, hinit->pool->log, 0,
@@ -186,7 +187,7 @@ ngx_hash_init(ngx_hash_init_t *hinit, ngx_hash_key_t *names, ngx_uint_t nelts)
size, key, test[key], &names[n].key);
#endif
- if (test[key] > bucket_size) {
+ if (test[key] > (u_short) bucket_size) {
goto next;
}
}
@@ -199,7 +200,7 @@ ngx_hash_init(ngx_hash_init_t *hinit, ngx_hash_key_t *names, ngx_uint_t nelts)
}
ngx_log_error(NGX_LOG_EMERG, hinit->pool->log, 0,
- "could not build the %s hash, you should increase "
+ "could not build the %s, you should increase "
"either %s_max_size: %i or %s_bucket_size: %i",
hinit->name, hinit->name, hinit->max_size,
hinit->name, hinit->bucket_size);
@@ -220,7 +221,7 @@ found:
}
key = names[n].key_hash % size;
- test[key] += NGX_HASH_ELT_SIZE(&names[n]);
+ test[key] = (u_short) (test[key] + NGX_HASH_ELT_SIZE(&names[n]));
}
len = 0;
@@ -230,7 +231,7 @@ found:
continue;
}
- test[i] = ngx_align(test[i], ngx_cacheline_size);
+ test[i] = (u_short) (ngx_align(test[i], ngx_cacheline_size));
len += test[i];
}
@@ -291,7 +292,7 @@ found:
elt->name[i] = ngx_tolower(names[n].key.data[i]);
}
- test[key] += NGX_HASH_ELT_SIZE(&names[n]);
+ test[key] = (u_short) (test[key] + NGX_HASH_ELT_SIZE(&names[n]));
}
for (i = 0; i < size; i++) {