nginx-0.3.52-RELEASE import
*) Change: the ngx_http_index_module behavior for the "POST /" requests
is reverted to the 0.3.40 version state: the module now does not
return the 405 error.
*) Bugfix: the worker process may got caught in an endless loop if the
limit rate was used; the bug had appeared in 0.3.37.
*) Bugfix: ngx_http_charset_module logged "unknown charset" alert, even
if the recoding was not needed; the bug had appeared in 0.3.50.
*) Bugfix: if a code response of the PUT request was 409, then a
temporary file was not removed.
diff --git a/docs/xml/nginx/changes.xml b/docs/xml/nginx/changes.xml
index 635851b..cb5cbb6 100644
--- a/docs/xml/nginx/changes.xml
+++ b/docs/xml/nginx/changes.xml
@@ -9,6 +9,57 @@
<title lang="en">nginx changelog</title>
+<changes ver="0.3.52" date="03.07.2006">
+
+<change type="change">
+<para lang="ru">
+×ÏÓÓÔÁÎÏ×ÌÅÎÏ ÐÏ×ÅÄÅÎÉÅ ÍÏÄÕÌÑ ngx_http_index_module ÄÌÑ ÚÁÐÒÏÓÏ× "POST /":
+ËÁË × ×ÅÒÓÉÉ ÄÏ 0.3.40, ÍÏÄÕÌØ ÔÅÐÅÒØ ÎÅ ×ÙÄÁ£Ô ÏÛÉÂËÕ 405.
+</para>
+<para lang="en">
+the ngx_http_index_module behavior for the "POST /" requests is reverted
+to the 0.3.40 version state: the module now does not return the 405 error.
+</para>
+</change>
+
+<change type="bugfix">
+<para lang="ru">
+ÐÒÉ ÉÓÐÏÌØÚÏ×ÁÎÉÉ ÏÇÒÁÎÉÞÅÎÉÑ ÓËÏÒÏÓÔÉ ÒÁÂÏÞÉÊ ÐÒÏÃÅÓÓ ÍÏÇ ÚÁÃÉËÌÉÔØÓÑ;
+ÏÛÉÂËÁ ÐÏÑ×ÉÌÁÓØ × 0.3.37.
+</para>
+<para lang="en">
+the worker process may got caught in an endless loop if the limit rate was used;
+bug appeared in 0.3.37.
+</para>
+</change>
+
+<change type="bugfix">
+<para lang="ru">
+ÍÏÄÕÌØ ngx_http_charset_module ÚÁÐÉÓÙ×ÁÌ × ÌÏÇ ÏÛÉÂËÕ "unknown charset",
+ÄÁÖÅ ÅÓÌÉ ÐÅÒÅËÏÄÉÒÏ×ËÁ ÎÅ ÔÒÅÂÏ×ÁÌÁÓØ;
+ÏÛÉÂËÁ ÐÏÑ×ÉÌÁÓØ × 0.3.50.
+</para>
+<para lang="en">
+ngx_http_charset_module logged "unknown charset" alert, even if the recoding
+was not needed;
+bug appeared in 0.3.50.
+</para>
+</change>
+
+<change type="bugfix">
+<para lang="ru">
+ÅÓÌÉ × ÒÅÚÕÌØÔÁÔÅ ÚÁÐÒÏÓÁ PUT ×ÏÚ×ÒÁÝÁÌÓÑ ËÏÄ 409, ÔÏ ×ÒÅÍÅÎÎÙÊ ÆÁÊÌ
+ÎÅ ÕÄÁÌÑÌÓÑ.
+</para>
+<para lang="en">
+if a code response of the PUT request was 409, then a temporary file
+was not removed.
+</para>
+</change>
+
+</changes>
+
+
<changes ver="0.3.51" date="30.06.2006">
<change type="bugfix">
diff --git a/src/core/nginx.h b/src/core/nginx.h
index 91b6af2..ad8c768 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.51"
+#define NGINX_VER "nginx/0.3.52"
#define NGINX_VAR "NGINX"
#define NGX_OLDPID_EXT ".oldbin"
diff --git a/src/core/ngx_file.c b/src/core/ngx_file.c
index c3c4592..0d094ec 100644
--- a/src/core/ngx_file.c
+++ b/src/core/ngx_file.c
@@ -259,6 +259,10 @@
path->name = value[1];
+ if (path->name.data[path->name.len - 1] == '/') {
+ path->name.len--;
+ }
+
if (ngx_conf_full_name(cf->cycle, &path->name) == NGX_ERROR) {
return NULL;
}
diff --git a/src/http/modules/ngx_http_charset_filter_module.c b/src/http/modules/ngx_http_charset_filter_module.c
index b467e4d..41a0e57 100644
--- a/src/http/modules/ngx_http_charset_filter_module.c
+++ b/src/http/modules/ngx_http_charset_filter_module.c
@@ -215,7 +215,7 @@
r->headers_out.override_charset->data);
if (charset == NGX_HTTP_NO_CHARSET) {
- ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
+ ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
"unknown charset \"%V\" to override",
r->headers_out.override_charset);
@@ -269,18 +269,8 @@
ctx->charset = charset;
- if (charset == NGX_HTTP_NO_CHARSET) {
- ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
- "unknown charset \"%V\" of main request", mc);
-
- return ngx_http_next_header_filter(r);
- }
- }
-
- charset = ctx->charset;
-
- if (charset == NGX_HTTP_NO_CHARSET) {
- return ngx_http_next_header_filter(r);
+ } else {
+ charset = ctx->charset;
}
}
@@ -289,16 +279,41 @@
if (r->headers_out.charset.len == 0) {
lcf = ngx_http_get_module_loc_conf(r, ngx_http_charset_filter_module);
- return ngx_http_charset_set_charset(r, mcf->charsets.elts, charset,
- lcf->source_charset);
+ if (charset != NGX_HTTP_NO_CHARSET) {
+ return ngx_http_charset_set_charset(r, mcf->charsets.elts, charset,
+ lcf->source_charset);
+ }
+
+ if (lcf->source_charset == NGX_CONF_UNSET) {
+ return ngx_http_next_header_filter(r);
+ }
+
+ ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
+ "no \"charset_map\" between the charsets "
+ "\"%V\" and \"%V\"",
+ &charsets[lcf->source_charset].name,
+ &r->main->headers_out.charset);
+
+ return ngx_http_next_header_filter(r);
}
source_charset = ngx_http_charset_get_charset(charsets, n,
r->headers_out.charset.data);
- if (source_charset == NGX_HTTP_NO_CHARSET) {
- ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
- "unknown source charset \"%V\"", &r->headers_out.charset);
+ if (charset == NGX_HTTP_NO_CHARSET
+ || source_charset == NGX_HTTP_NO_CHARSET)
+ {
+ if (charset != source_charset
+ || ngx_strcasecmp(r->main->headers_out.charset.data,
+ r->headers_out.charset.data)
+ != 0)
+ {
+ ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
+ "no \"charset_map\" between the charsets "
+ "\"%V\" and \"%V\"",
+ &r->headers_out.charset,
+ &r->main->headers_out.charset);
+ }
return ngx_http_next_header_filter(r);
}
@@ -307,7 +322,7 @@
&& (charsets[source_charset].tables == NULL
|| charsets[source_charset].tables[charset] == NULL))
{
- ngx_log_error(NGX_LOG_ALERT, r->connection->log, 0,
+ ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
"no \"charset_map\" between the charsets "
"\"%V\" and \"%V\"",
&charsets[source_charset].name, &charsets[charset].name);
diff --git a/src/http/modules/ngx_http_dav_module.c b/src/http/modules/ngx_http_dav_module.c
index b41bd8e..7f61774 100644
--- a/src/http/modules/ngx_http_dav_module.c
+++ b/src/http/modules/ngx_http_dav_module.c
@@ -254,6 +254,12 @@
}
if (ngx_is_dir(&fi)) {
+ if (ngx_delete_file(temp->data) == NGX_FILE_ERROR) {
+ ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno,
+ ngx_delete_file_n " \"%s\" failed",
+ temp->data);
+ }
+
ngx_http_finalize_request(r, NGX_HTTP_CONFLICT);
return;
}
@@ -296,6 +302,12 @@
#endif
+ if (ngx_delete_file(temp->data) == NGX_FILE_ERROR) {
+ ngx_log_error(NGX_LOG_CRIT, r->connection->log, ngx_errno,
+ ngx_delete_file_n " \"%s\" failed",
+ temp->data);
+ }
+
ngx_http_finalize_request(r, ngx_http_dav_error(r, err, NGX_HTTP_CONFLICT,
ngx_rename_file_n,
path.data));
diff --git a/src/http/modules/ngx_http_index_module.c b/src/http/modules/ngx_http_index_module.c
index d4bed45..4ef2910 100644
--- a/src/http/modules/ngx_http_index_module.c
+++ b/src/http/modules/ngx_http_index_module.c
@@ -143,10 +143,6 @@
return NGX_DECLINED;
}
- if (!(r->method & (NGX_HTTP_GET|NGX_HTTP_HEAD))) {
- return NGX_DECLINED;
- }
-
log = r->connection->log;
/*
diff --git a/src/http/ngx_http_write_filter_module.c b/src/http/ngx_http_write_filter_module.c
index 5f6715c..3d991c7 100644
--- a/src/http/ngx_http_write_filter_module.c
+++ b/src/http/ngx_http_write_filter_module.c
@@ -215,7 +215,7 @@
if (to_send <= 0) {
c->write->delayed = 1;
ngx_add_timer(r->connection->write,
- (ngx_msec_t) (- to_send * 1000 / r->limit_rate));
+ (ngx_msec_t) (- to_send * 1000 / r->limit_rate + 1));
c->buffered |= NGX_HTTP_WRITE_BUFFERED;
@@ -245,7 +245,7 @@
sent = c->sent - sent;
c->write->delayed = 1;
ngx_add_timer(r->connection->write,
- (ngx_msec_t) (sent * 1000 / r->limit_rate));
+ (ngx_msec_t) (sent * 1000 / r->limit_rate + 1));
}
for (cl = r->out; cl && cl != chain; /* void */) {