nginx-0.1.4-RELEASE import

*) Bugfix: in the ngx_http_autoindex_module.
This commit is contained in:
Igor Sysoev 2004-10-26 06:27:24 +00:00
parent 66d28f5f59
commit 1405efbe2f
3 changed files with 36 additions and 19 deletions

View File

@ -6,6 +6,20 @@
title="nginx">
<changes ver="0.1.4" date="26.10.2004">
<change type="bugfix">
<para lang="ru">
ÏÛÉÂËÁ × ÍÏÄÕÌÅ ngx_http_autoindex_module.
</para>
<para lang="en">
in the ngx_http_autoindex_module.
</para>
</change>
</changes>
<changes ver="0.1.3" date="25.10.2004">
<change type="feature">
@ -38,6 +52,7 @@ proxy module may get caught in an endless loop when sendfile is not used.
</changes>
<changes ver="0.1.2" date="21.10.2004">
<change type="feature">

View File

@ -8,7 +8,7 @@
#define _NGINX_H_INCLUDED_
#define NGINX_VER "nginx/0.1.3"
#define NGINX_VER "nginx/0.1.4"
#define NGINX_VAR "NGINX"
#define NGX_NEWPID_EXT ".newbin"

View File

@ -230,6 +230,17 @@ static ngx_int_t ngx_http_autoindex_handler(ngx_http_request_t *r)
len = ngx_de_namelen(&dir);
if (len == 1 && ngx_de_name(&dir)[0] == '.') {
continue;
}
if (len == 2
&& ngx_de_name(&dir)[0] == '.'
&& ngx_de_name(&dir)[0] == '.')
{
continue;
}
if (!dir.valid_info) {
if (dname.len + 1 + len > fname.len) {
@ -253,17 +264,6 @@ static ngx_int_t ngx_http_autoindex_handler(ngx_http_request_t *r)
}
}
if (len == 1 && ngx_de_name(&dir)[0] == '.') {
continue;
}
if (len == 2
&& ngx_de_name(&dir)[0] == '.'
&& ngx_de_name(&dir)[0] == '.')
{
continue;
}
if (!(entry = ngx_array_push(&entries))) {
return ngx_http_autoindex_error(r, &dir, dname.data);
}
@ -375,24 +375,24 @@ static ngx_int_t ngx_http_autoindex_handler(ngx_http_request_t *r)
} else {
length = entry[i].size;
if (length > 999999999) {
size = (ngx_int_t) length / 1024 * 1024 * 1024;
if ((length % 1024 * 1024 * 1024)
if (length > 1024 * 1024 * 1024) {
size = (ngx_int_t) (length / (1024 * 1024 * 1024));
if ((length % (1024 * 1024 * 1024))
> (1024 * 1024 * 1024 / 2 - 1))
{
size++;
}
scale = 'G';
} else if (length > 999999) {
size = (ngx_int_t) length / 1024 * 1024;
if ((length % 1024 * 1024) > (1024 * 1024 / 2 - 1)) {
} else if (length > 1024 * 1024) {
size = (ngx_int_t) (length / (1024 * 1024));
if ((length % (1024 * 1024)) > (1024 * 1024 / 2 - 1)) {
size++;
}
scale = 'M';
} else if (length > 9999) {
size = (ngx_int_t) length / 1024;
size = (ngx_int_t) (length / 1024);
if (length % 1024 > 511) {
size++;
}
@ -414,6 +414,8 @@ static ngx_int_t ngx_http_autoindex_handler(ngx_http_request_t *r)
*b->last++ = LF;
}
/* TODO: free temporary pool */
b->last = ngx_cpymem(b->last, "</pre><hr>", sizeof("</pre><hr>") - 1);
b->last = ngx_cpymem(b->last, tail, sizeof(tail) - 1);