Skip to content

Commit

Permalink
nginx-0.3.19-RELEASE import
Browse files Browse the repository at this point in the history
    *) Feature: the "path" and "alias" directives support the variables.

    *) Change: now the "valid_referers" directive again checks the URI part.

    *) Bugfix: in SSI handling.
  • Loading branch information
igorsysoev committed Dec 28, 2005
1 parent b0b4973 commit 3ca233e
Show file tree
Hide file tree
Showing 12 changed files with 247 additions and 74 deletions.
6 changes: 6 additions & 0 deletions auto/cc/icc
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,17 @@ case "$NGX_ICC_VER" in
# conversion from pointer to same-sized integral type,
# warning on offsetof()
CFLAGS="$CFLAGS -wd1684"
# floating-point equality and inequality comparisons are unreliable,
# warning on SvTRUE()
CFLAGS="$CFLAGS -wd1572"
;;

8.*)
# "cc" clobber ignored, warnings for Liunx's htonl()/htons()
CFLAGS="$CFLAGS -wd1469"
# floating-point equality and inequality comparisons are unreliable,
# warning on SvTRUE()
CFLAGS="$CFLAGS -wd1572"
;;

*)
Expand Down
32 changes: 32 additions & 0 deletions docs/xml/nginx/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,38 @@
<title lang="en">nginx changelog</title>


<changes ver="0.3.19" date="28.12.2005">

<change type="feature">
<para lang="ru">
ÄÉÒÅËÔÉ×Ù path É alias ÐÏÄÄÅÒÖÉ×ÁÀÔ ÐÅÒÅÍÅÎÎÙÅ.
</para>
<para lang="en">
the "path" and "alias" directives support the variables.
</para>
</change>

<change type="change">
<para lang="ru">
ÔÅÐÅÒØ ÄÉÒÅËÔÉ×Á valid_referers ÏÐÑÔØ ÕÞÉÔÙ×ÁÅÔ URI.
</para>
<para lang="en">
now the "valid_referers" directive again checks the URI part.
</para>
</change>

<change type="bugfix">
<para lang="ru">
ÏÛÉÂËÉ × ÏÂÒÁÂÏÔËÅ SSI.
</para>
<para lang="en">
in SSI handling.
</para>
</change>

</changes>


<changes ver="0.3.18" date="26.12.2005">

<change type="feature">
Expand Down
2 changes: 1 addition & 1 deletion src/core/nginx.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 5 additions & 0 deletions src/core/ngx_buf.h
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
23 changes: 12 additions & 11 deletions src/core/ngx_hash.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
}
Expand All @@ -170,23 +171,23 @@ 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) {
continue;
}

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,
"%ui: %ui %ui \"%V\"",
size, key, test[key], &names[n].key);
#endif

if (test[key] > bucket_size) {
if (test[key] > (u_short) bucket_size) {
goto next;
}
}
Expand All @@ -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);
Expand All @@ -220,7 +221,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]));
}

len = 0;
Expand All @@ -230,7 +231,7 @@ ngx_hash_init(ngx_hash_init_t *hinit, ngx_hash_key_t *names, ngx_uint_t nelts)
continue;
}

test[i] = ngx_align(test[i], ngx_cacheline_size);
test[i] = (u_short) (ngx_align(test[i], ngx_cacheline_size));

len += test[i];
}
Expand Down Expand Up @@ -291,7 +292,7 @@ ngx_hash_init(ngx_hash_init_t *hinit, ngx_hash_key_t *names, ngx_uint_t nelts)
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++) {
Expand Down
2 changes: 1 addition & 1 deletion src/http/modules/ngx_http_index_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ ngx_http_index_handler(ngx_http_request_t *r)
uri.len = r->uri.len + ctx->index.len - 1;

if (!clcf->alias) {
uri.data = ctx->path.data + clcf->root.len;
uri.data = ctx->path.data + r->root_length;

} else {
uri.data = ngx_palloc(r->pool, uri.len);
Expand Down
Loading

0 comments on commit 3ca233e

Please sign in to comment.