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
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2005-06-23 17:41:06 +0400
committerIgor Sysoev <igor@sysoev.ru>2005-06-23 17:41:06 +0400
commit85ef94ba857237882c7e68dea87a1dbc68a38fe7 (patch)
tree1bc05e18adaabc75f91f1c7b34c7358e60b0efdc /src/http/modules
parent2e87bb645af1d3152c9961d49ca093d4cbfe630d (diff)
nginx-0.1.37-RELEASE importrelease-0.1.37
*) Change: now the "\n" is added to the end of the "nginx.pid" file. *) Bugfix: the responses may be transferred not completely, if many parts or the big parts were included by SSI. *) Bugfix: if all backends had returned the 404 reponse and the "http_404" parameter of the "proxy_next_upstream" or "fastcgi_next_upstream" directives was used, then nginx started to request all backends again.
Diffstat (limited to 'src/http/modules')
-rw-r--r--src/http/modules/ngx_http_autoindex_module.c37
-rw-r--r--src/http/modules/ngx_http_charset_filter_module.c11
2 files changed, 19 insertions, 29 deletions
diff --git a/src/http/modules/ngx_http_autoindex_module.c b/src/http/modules/ngx_http_autoindex_module.c
index ab4418f9b..e26d2947e 100644
--- a/src/http/modules/ngx_http_autoindex_module.c
+++ b/src/http/modules/ngx_http_autoindex_module.c
@@ -24,6 +24,7 @@ typedef struct {
typedef struct {
ngx_str_t name;
+ size_t utf_len;
ngx_uint_t escape;
ngx_uint_t dir;
time_t mtime;
@@ -212,7 +213,7 @@ ngx_http_autoindex_handler(ngx_http_request_t *r)
#endif
if (ngx_array_init(&entries, pool, 50, sizeof(ngx_http_autoindex_entry_t))
- == NGX_ERROR)
+ == NGX_ERROR)
{
return ngx_http_autoindex_error(r, &dir, dname.data);
}
@@ -304,6 +305,7 @@ ngx_http_autoindex_handler(ngx_http_request_t *r)
}
entry->name.len = len;
+
entry->escape = 2 * ngx_escape_uri(NULL, ngx_de_name(&dir), len,
NGX_ESCAPE_HTML);
@@ -314,6 +316,12 @@ ngx_http_autoindex_handler(ngx_http_request_t *r)
ngx_cpystrn(entry->name.data, ngx_de_name(&dir), len + 1);
+ if (r->utf8) {
+ entry->utf_len = ngx_utf_length(&entry->name);
+ } else {
+ entry->utf_len = len;
+ }
+
entry->dir = ngx_de_is_dir(&dir);
entry->mtime = ngx_de_mtime(&dir);
entry->size = ngx_de_size(&dir);
@@ -336,18 +344,15 @@ ngx_http_autoindex_handler(ngx_http_request_t *r)
entry = entries.elts;
for (i = 0; i < entries.nelts; i++) {
len += sizeof("<a href=\"") - 1
- + 1 /* 1 is for "/" */
- + entry[i].name.len + entry[i].escape
- + sizeof("\">") - 1
- + NGX_HTTP_AUTOINDEX_NAME_LEN + sizeof("&gt;") - 2
- + sizeof("</a>") - 1
- + sizeof(" 28-Sep-1970 12:00 ") - 1
- + 19
- + 2;
-
- if (r->utf8) {
- len += entry[i].name.len - ngx_utf_length(&entry[i].name);
- }
+ + 1 /* 1 is for "/" */
+ + entry[i].name.len + entry[i].escape
+ + sizeof("\">") - 1
+ + entry[i].name.len - entry[i].utf_len
+ + NGX_HTTP_AUTOINDEX_NAME_LEN + sizeof("&gt;") - 2
+ + sizeof("</a>") - 1
+ + sizeof(" 28-Sep-1970 12:00 ") - 1
+ + 19
+ + 2;
}
b = ngx_create_temp_buf(r->pool, len);
@@ -394,11 +399,7 @@ ngx_http_autoindex_handler(ngx_http_request_t *r)
b->last = ngx_cpystrn(b->last, entry[i].name.data,
NGX_HTTP_AUTOINDEX_NAME_LEN + 1);
- if (r->utf8) {
- len = ngx_utf_length(&entry[i].name);
- } else {
- len = entry[i].name.len;
- }
+ len = entry[i].utf_len;
if (len > NGX_HTTP_AUTOINDEX_NAME_LEN) {
b->last = ngx_cpymem(b->last - 3, "..&gt;</a>",
diff --git a/src/http/modules/ngx_http_charset_filter_module.c b/src/http/modules/ngx_http_charset_filter_module.c
index 117281ca2..caf3f3f70 100644
--- a/src/http/modules/ngx_http_charset_filter_module.c
+++ b/src/http/modules/ngx_http_charset_filter_module.c
@@ -34,7 +34,6 @@ typedef struct {
typedef struct {
ngx_flag_t enable;
- ngx_flag_t autodetect;
ngx_int_t default_charset;
ngx_int_t source_charset;
@@ -96,13 +95,6 @@ static ngx_command_t ngx_http_charset_filter_commands[] = {
offsetof(ngx_http_charset_loc_conf_t, enable),
NULL },
- { ngx_string("autodetect_charset"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
- ngx_conf_set_flag_slot,
- NGX_HTTP_LOC_CONF_OFFSET,
- offsetof(ngx_http_charset_loc_conf_t, autodetect),
- NULL },
-
ngx_null_command
};
@@ -570,7 +562,6 @@ ngx_http_charset_create_loc_conf(ngx_conf_t *cf)
}
lcf->enable = NGX_CONF_UNSET;
- lcf->autodetect = NGX_CONF_UNSET;
lcf->default_charset = NGX_CONF_UNSET;
lcf->source_charset = NGX_CONF_UNSET;
@@ -585,8 +576,6 @@ ngx_http_charset_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
ngx_http_charset_loc_conf_t *conf = child;
ngx_conf_merge_value(conf->enable, prev->enable, 0);
- ngx_conf_merge_value(conf->autodetect, prev->autodetect, 0);
-
if (conf->default_charset == NGX_CONF_UNSET) {
conf->default_charset = prev->default_charset;