summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2010-04-22 17:37:28 +0000
committerJonathan Kolb <jon@b0g.us>2010-04-22 17:37:28 +0000
commit5b1ac2a50033b677b8f240743b6b7720b7f42bf0 (patch)
tree0813a9927483a684c808fc10700d17f889d7fb90
parentc9bc330f78ce3dbf16f9421a90e5c544970b4170 (diff)
downloadnginx-0.8.36.tar.gz
Changes with nginx 0.8.36 22 Apr 2010v0.8.36
*) Bugfix: the ngx_http_dav_module handled incorrectly the DELETE, COPY, and MOVE methods for symlinks. *) Bugfix: values of the $query_string, $arg_..., etc. variables cached in main request were used by the SSI module in subrequests. *) Bugfix: a variable value was repeatedly encoded after each an "echo" SSI-command output; the bug had appeared in 0.6.14. *) Bugfix: a worker process hung if a FIFO file was requested. Thanks to Vicente Aguilar and Maxim Dounin. *) Bugfix: OpenSSL-1.0.0 compatibility on 64-bit Linux. Thanks to Maxim Dounin. *) Bugfix: nginx could not be built --without-http-cache; the bug had appeared in 0.8.35.
-rw-r--r--CHANGES23
-rw-r--r--CHANGES.ru24
-rw-r--r--auto/lib/openssl/make2
-rw-r--r--src/core/nginx.h4
-rw-r--r--src/core/ngx_open_file_cache.c9
-rw-r--r--src/http/modules/ngx_http_dav_module.c14
-rw-r--r--src/http/modules/ngx_http_fastcgi_module.c6
-rw-r--r--src/http/modules/ngx_http_gzip_static_module.c2
-rw-r--r--src/http/modules/ngx_http_ssi_filter_module.c29
-rw-r--r--src/http/modules/ngx_http_static_module.c2
-rw-r--r--src/http/modules/perl/nginx.pm2
-rw-r--r--src/http/modules/perl/nginx.xs2
-rw-r--r--src/http/ngx_http_variables.c11
-rw-r--r--src/http/ngx_http_variables.h2
-rw-r--r--src/os/unix/ngx_files.h4
15 files changed, 91 insertions, 45 deletions
diff --git a/CHANGES b/CHANGES
index bd35ac388..0f3e063d5 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,26 @@
-Changes with nginx 0.8.35 29 Mar 2010
+Changes with nginx 0.8.36 22 Apr 2010
+
+ *) Bugfix: the ngx_http_dav_module handled incorrectly the DELETE,
+ COPY, and MOVE methods for symlinks.
+
+ *) Bugfix: values of the $query_string, $arg_..., etc. variables cached
+ in main request were used by the SSI module in subrequests.
+
+ *) Bugfix: a variable value was repeatedly encoded after each an "echo"
+ SSI-command output; the bug had appeared in 0.6.14.
+
+ *) Bugfix: a worker process hung if a FIFO file was requested.
+ Thanks to Vicente Aguilar and Maxim Dounin.
+
+ *) Bugfix: OpenSSL-1.0.0 compatibility on 64-bit Linux.
+ Thanks to Maxim Dounin.
+
+ *) Bugfix: nginx could not be built --without-http-cache; the bug had
+ appeared in 0.8.35.
+
+
+Changes with nginx 0.8.35 01 Apr 2010
*) Change: now the charset filter runs before the SSI filter.
diff --git a/CHANGES.ru b/CHANGES.ru
index f20412b64..443bd8fa7 100644
--- a/CHANGES.ru
+++ b/CHANGES.ru
@@ -1,5 +1,27 @@
-Изменения в nginx 0.8.35 29.03.2010
+Изменения в nginx 0.8.36 22.04.2010
+
+ *) Исправление: модуль ngx_http_dav_module неправильно обрабатывал
+ методы DELETE, COPY и MOVE для симлинков.
+
+ *) Исправление: модуль SSI в подзапросах использовал закэшированные в
+ основном запросе значения переменных $query_string, $arg_... и им
+ подобных.
+
+ *) Исправление: значение переменной повторно экранировалось после
+ каждого вывода SSI-команды echo; ошибка появилась в 0.6.14.
+
+ *) Исправление: рабочий процесс зависал при запросе файла FIFO.
+ Спасибо Vicente Aguilar и Максиму Дунину.
+
+ *) Исправление: совместимость с OpenSSL-1.0.0 на 64-битном Linux.
+ Спасибо Максиму Дунину.
+
+ *) Исправление: nginx не собирался с параметром --without-http-cache;
+ ошибка появилась в 0.8.35.
+
+
+Изменения в nginx 0.8.35 01.04.2010
*) Изменение: теперь charset-фильтр работает до SSI-фильтра.
diff --git a/auto/lib/openssl/make b/auto/lib/openssl/make
index d497d88e1..a2025bbd6 100644
--- a/auto/lib/openssl/make
+++ b/auto/lib/openssl/make
@@ -57,7 +57,7 @@ $OPENSSL/.openssl/include/openssl/ssl.h: $NGX_MAKEFILE
&& \$(MAKE) clean \\
&& ./config --prefix=$ngx_prefix no-shared $OPENSSL_OPT \\
&& \$(MAKE) \\
- && \$(MAKE) install
+ && \$(MAKE) install LIBDIR=lib
END
diff --git a/src/core/nginx.h b/src/core/nginx.h
index d3da2b3bf..939fad048 100644
--- a/src/core/nginx.h
+++ b/src/core/nginx.h
@@ -8,8 +8,8 @@
#define _NGINX_H_INCLUDED_
-#define nginx_version 8035
-#define NGINX_VERSION "0.8.35"
+#define nginx_version 8036
+#define NGINX_VERSION "0.8.36"
#define NGINX_VER "nginx/" NGINX_VERSION
#define NGINX_VAR "NGINX"
diff --git a/src/core/ngx_open_file_cache.c b/src/core/ngx_open_file_cache.c
index 6aa66fd4e..a9c45324d 100644
--- a/src/core/ngx_open_file_cache.c
+++ b/src/core/ngx_open_file_cache.c
@@ -490,7 +490,14 @@ ngx_open_and_stat_file(u_char *name, ngx_open_file_info_t *of, ngx_log_t *log)
}
if (!of->log) {
- fd = ngx_open_file(name, NGX_FILE_RDONLY, NGX_FILE_OPEN, 0);
+
+ /*
+ * Use non-blocking open() not to hang on FIFO files, etc.
+ * This flag has no effect on a regular files.
+ */
+
+ fd = ngx_open_file(name, NGX_FILE_RDONLY|NGX_FILE_NONBLOCK,
+ NGX_FILE_OPEN, 0);
} else {
fd = ngx_open_file(name, NGX_FILE_APPEND, NGX_FILE_CREATE_OR_OPEN,
diff --git a/src/http/modules/ngx_http_dav_module.c b/src/http/modules/ngx_http_dav_module.c
index 2948eec06..4b561105c 100644
--- a/src/http/modules/ngx_http_dav_module.c
+++ b/src/http/modules/ngx_http_dav_module.c
@@ -325,13 +325,13 @@ ok:
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"http delete filename: \"%s\"", path.data);
- if (ngx_file_info(path.data, &fi) == NGX_FILE_ERROR) {
+ if (ngx_link_info(path.data, &fi) == NGX_FILE_ERROR) {
err = ngx_errno;
rc = (err == NGX_ENOTDIR) ? NGX_HTTP_CONFLICT : NGX_HTTP_NOT_FOUND;
return ngx_http_dav_error(r->connection->log, err,
- rc, ngx_file_info_n, path.data);
+ rc, ngx_link_info_n, path.data);
}
if (ngx_is_dir(&fi)) {
@@ -358,7 +358,7 @@ ok:
/*
* we do not need to test (r->uri.data[r->uri.len - 1] == '/')
- * because ngx_file_info("/file/") returned NGX_ENOTDIR above
+ * because ngx_link_info("/file/") returned NGX_ENOTDIR above
*/
depth = ngx_http_dav_depth(r, 0);
@@ -685,12 +685,12 @@ overwrite_done:
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"http copy to: \"%s\"", copy.path.data);
- if (ngx_file_info(copy.path.data, &fi) == NGX_FILE_ERROR) {
+ if (ngx_link_info(copy.path.data, &fi) == NGX_FILE_ERROR) {
err = ngx_errno;
if (err != NGX_ENOENT) {
return ngx_http_dav_error(r->connection->log, err,
- NGX_HTTP_NOT_FOUND, ngx_file_info_n,
+ NGX_HTTP_NOT_FOUND, ngx_link_info_n,
copy.path.data);
}
@@ -719,9 +719,9 @@ overwrite_done:
dir = ngx_is_dir(&fi);
}
- if (ngx_file_info(path.data, &fi) == NGX_FILE_ERROR) {
+ if (ngx_link_info(path.data, &fi) == NGX_FILE_ERROR) {
return ngx_http_dav_error(r->connection->log, ngx_errno,
- NGX_HTTP_NOT_FOUND, ngx_file_info_n,
+ NGX_HTTP_NOT_FOUND, ngx_link_info_n,
path.data);
}
diff --git a/src/http/modules/ngx_http_fastcgi_module.c b/src/http/modules/ngx_http_fastcgi_module.c
index b09b3307a..77b6d9d38 100644
--- a/src/http/modules/ngx_http_fastcgi_module.c
+++ b/src/http/modules/ngx_http_fastcgi_module.c
@@ -1101,7 +1101,6 @@ ngx_http_fastcgi_process_header(ngx_http_request_t *r)
ngx_table_elt_t *h;
ngx_http_upstream_t *u;
ngx_http_fastcgi_ctx_t *f;
- ngx_http_fastcgi_header_t *fh;
ngx_http_upstream_header_t *hh;
ngx_http_fastcgi_loc_conf_t *flcf;
ngx_http_fastcgi_split_part_t *part;
@@ -1255,8 +1254,9 @@ ngx_http_fastcgi_process_header(ngx_http_request_t *r)
#if (NGX_HTTP_CACHE)
if (f->large_stderr && r->cache) {
- u_char *start;
- ssize_t len;
+ u_char *start;
+ ssize_t len;
+ ngx_http_fastcgi_header_t *fh;
start = u->buffer.start + r->cache->header_start;
diff --git a/src/http/modules/ngx_http_gzip_static_module.c b/src/http/modules/ngx_http_gzip_static_module.c
index a928d16ae..2098d8c43 100644
--- a/src/http/modules/ngx_http_gzip_static_module.c
+++ b/src/http/modules/ngx_http_gzip_static_module.c
@@ -180,7 +180,7 @@ ngx_http_gzip_static_handler(ngx_http_request_t *r)
#if !(NGX_WIN32) /* the not regular files are probably Unix specific */
if (!of.is_file) {
- ngx_log_error(NGX_LOG_CRIT, log, ngx_errno,
+ ngx_log_error(NGX_LOG_CRIT, log, 0,
"\"%s\" is not a regular file", path.data);
return NGX_HTTP_NOT_FOUND;
diff --git a/src/http/modules/ngx_http_ssi_filter_module.c b/src/http/modules/ngx_http_ssi_filter_module.c
index 6dcce3f31..7a2beede1 100644
--- a/src/http/modules/ngx_http_ssi_filter_module.c
+++ b/src/http/modules/ngx_http_ssi_filter_module.c
@@ -14,7 +14,6 @@
#define NGX_HTTP_SSI_ADD_PREFIX 1
#define NGX_HTTP_SSI_ADD_ZERO 2
-#define NGX_HTTP_SSI_EXPR_TEST 4
typedef struct {
@@ -1701,8 +1700,7 @@ ngx_http_ssi_evaluate_string(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx,
val = ngx_http_ssi_get_variable(r, &var, key);
if (val == NULL) {
- vv = ngx_http_get_variable(r, &var, key,
- flags & NGX_HTTP_SSI_EXPR_TEST);
+ vv = ngx_http_get_variable(r, &var, key);
if (vv == NULL) {
return NGX_ERROR;
}
@@ -2110,7 +2108,7 @@ ngx_http_ssi_echo(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx,
value = ngx_http_ssi_get_variable(r, var, key);
if (value == NULL) {
- vv = ngx_http_get_variable(r, var, key, 1);
+ vv = ngx_http_get_variable(r, var, key);
if (vv == NULL) {
return NGX_HTTP_SSI_ERROR;
@@ -2161,10 +2159,9 @@ ngx_http_ssi_echo(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx,
}
}
- switch (ctx->encoding) {
+ p = value->data;
- case NGX_HTTP_SSI_NO_ENCODING:
- break;
+ switch (ctx->encoding) {
case NGX_HTTP_SSI_URL_ENCODING:
len = 2 * ngx_escape_uri(NULL, value->data, value->len,
@@ -2177,11 +2174,9 @@ ngx_http_ssi_echo(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx,
}
(void) ngx_escape_uri(p, value->data, value->len, NGX_ESCAPE_HTML);
-
- value->len += len;
- value->data = p;
}
+ len += value->len;
break;
case NGX_HTTP_SSI_ENTITY_ENCODING:
@@ -2194,11 +2189,13 @@ ngx_http_ssi_echo(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx,
}
(void) ngx_escape_html(p, value->data, value->len);
-
- value->len += len;
- value->data = p;
}
+ len += value->len;
+ break;
+
+ default: /* NGX_HTTP_SSI_NO_ENCODING */
+ len = value->len;
break;
}
@@ -2213,8 +2210,8 @@ ngx_http_ssi_echo(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx,
}
b->memory = 1;
- b->pos = value->data;
- b->last = value->data + value->len;
+ b->pos = p;
+ b->last = p + len;
cl->buf = b;
cl->next = NULL;
@@ -2362,7 +2359,7 @@ ngx_http_ssi_if(ngx_http_request_t *r, ngx_http_ssi_ctx_t *ctx,
p++;
}
- flags = (p == last) ? NGX_HTTP_SSI_EXPR_TEST : 0;
+ flags = 0;
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
"left: \"%V\"", &left);
diff --git a/src/http/modules/ngx_http_static_module.c b/src/http/modules/ngx_http_static_module.c
index 6743e769d..3af97bacd 100644
--- a/src/http/modules/ngx_http_static_module.c
+++ b/src/http/modules/ngx_http_static_module.c
@@ -189,7 +189,7 @@ ngx_http_static_handler(ngx_http_request_t *r)
#if !(NGX_WIN32) /* the not regular files are probably Unix specific */
if (!of.is_file) {
- ngx_log_error(NGX_LOG_CRIT, log, ngx_errno,
+ ngx_log_error(NGX_LOG_CRIT, log, 0,
"\"%s\" is not a regular file", path.data);
return NGX_HTTP_NOT_FOUND;
diff --git a/src/http/modules/perl/nginx.pm b/src/http/modules/perl/nginx.pm
index 709b05975..b2e895c99 100644
--- a/src/http/modules/perl/nginx.pm
+++ b/src/http/modules/perl/nginx.pm
@@ -47,7 +47,7 @@ our @EXPORT = qw(
HTTP_INSUFFICIENT_STORAGE
);
-our $VERSION = '0.8.35';
+our $VERSION = '0.8.36';
require XSLoader;
XSLoader::load('nginx', $VERSION);
diff --git a/src/http/modules/perl/nginx.xs b/src/http/modules/perl/nginx.xs
index 357b1b9ae..aef4c8b03 100644
--- a/src/http/modules/perl/nginx.xs
+++ b/src/http/modules/perl/nginx.xs
@@ -848,7 +848,7 @@ variable(r, name, value = NULL)
#endif
- vv = ngx_http_get_variable(r, &var, hash, 1);
+ vv = ngx_http_get_variable(r, &var, hash);
if (vv == NULL) {
XSRETURN_UNDEF;
}
diff --git a/src/http/ngx_http_variables.c b/src/http/ngx_http_variables.c
index f3fc9f683..c8d1c8dcb 100644
--- a/src/http/ngx_http_variables.c
+++ b/src/http/ngx_http_variables.c
@@ -441,8 +441,7 @@ ngx_http_get_flushed_variable(ngx_http_request_t *r, ngx_uint_t index)
ngx_http_variable_value_t *
-ngx_http_get_variable(ngx_http_request_t *r, ngx_str_t *name, ngx_uint_t key,
- ngx_uint_t nowarn)
+ngx_http_get_variable(ngx_http_request_t *r, ngx_str_t *name, ngx_uint_t key)
{
ngx_http_variable_t *v;
ngx_http_variable_value_t *vv;
@@ -454,7 +453,7 @@ ngx_http_get_variable(ngx_http_request_t *r, ngx_str_t *name, ngx_uint_t key,
if (v) {
if (v->flags & NGX_HTTP_VAR_INDEXED) {
- return ngx_http_get_indexed_variable(r, v->index);
+ return ngx_http_get_flushed_variable(r, v->index);
} else {
@@ -526,11 +525,6 @@ ngx_http_get_variable(ngx_http_request_t *r, ngx_str_t *name, ngx_uint_t key,
vv->not_found = 1;
- if (nowarn == 0) {
- ngx_log_error(NGX_LOG_ERR, r->connection->log, 0,
- "unknown \"%V\" variable", name);
- }
-
return vv;
}
@@ -1937,6 +1931,7 @@ ngx_http_variables_init_vars(ngx_conf_t *cf)
if (ngx_strncmp(v[i].name.data, "arg_", 4) == 0) {
v[i].get_handler = ngx_http_variable_argument;
v[i].data = (uintptr_t) &v[i].name;
+ v[i].flags = NGX_HTTP_VAR_NOCACHEABLE;
continue;
}
diff --git a/src/http/ngx_http_variables.h b/src/http/ngx_http_variables.h
index 80ce49321..9d4b29e08 100644
--- a/src/http/ngx_http_variables.h
+++ b/src/http/ngx_http_variables.h
@@ -50,7 +50,7 @@ ngx_http_variable_value_t *ngx_http_get_flushed_variable(ngx_http_request_t *r,
ngx_uint_t index);
ngx_http_variable_value_t *ngx_http_get_variable(ngx_http_request_t *r,
- ngx_str_t *name, ngx_uint_t key, ngx_uint_t nowarn);
+ ngx_str_t *name, ngx_uint_t key);
ngx_int_t ngx_http_variable_unknown_header(ngx_http_variable_value_t *v,
ngx_str_t *var, ngx_list_part_t *part, size_t prefix);
diff --git a/src/os/unix/ngx_files.h b/src/os/unix/ngx_files.h
index ccaf44a93..c40cfe2ea 100644
--- a/src/os/unix/ngx_files.h
+++ b/src/os/unix/ngx_files.h
@@ -64,6 +64,7 @@ typedef struct {
#define NGX_FILE_OPEN 0
#define NGX_FILE_TRUNCATE O_CREAT|O_TRUNC
#define NGX_FILE_APPEND O_WRONLY|O_APPEND
+#define NGX_FILE_NONBLOCK O_NONBLOCK
#define NGX_FILE_DEFAULT_ACCESS 0644
#define NGX_FILE_OWNER_ACCESS 0600
@@ -138,6 +139,9 @@ ngx_int_t ngx_set_file_time(u_char *name, ngx_fd_t fd, time_t s);
#define ngx_fd_info(fd, sb) fstat(fd, sb)
#define ngx_fd_info_n "fstat()"
+#define ngx_link_info(file, sb) lstat((const char *) file, sb)
+#define ngx_link_info_n "lstat()"
+
#define ngx_is_dir(sb) (S_ISDIR((sb)->st_mode))
#define ngx_is_file(sb) (S_ISREG((sb)->st_mode))
#define ngx_is_link(sb) (S_ISLNK((sb)->st_mode))