summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2009-03-18 12:46:42 +0000
committerJonathan Kolb <jon@b0g.us>2009-03-18 12:46:42 +0000
commitedb4d121199e5911d3c39a25ea36f63fa8dcf6a9 (patch)
tree07a0a6460f8b7f2269f5d969bf22fd2d2f9d7d41
parentf7282cf06b6d8c64ca160877c5f46a6043e0f78a (diff)
downloadnginx-0.7.43.tar.gz
Changes with nginx 0.7.43 18 Mar 2009v0.7.43
*) Bugfix: a request was handled incorrectly, if a "root" directive used variables; the bug had appeared in 0.7.42. *) Bugfix: if a server listened on wildcard address, then the $server_addr variable value was "0.0.0.0"; the bug had appeared in 0.7.36.
-rw-r--r--CHANGES12
-rw-r--r--CHANGES.ru9
-rw-r--r--src/core/nginx.h2
-rw-r--r--src/http/modules/ngx_http_auth_basic_module.c3
-rw-r--r--src/http/modules/perl/nginx.pm2
-rw-r--r--src/http/ngx_http_core_module.c37
-rw-r--r--src/http/ngx_http_request.c2
7 files changed, 54 insertions, 13 deletions
diff --git a/CHANGES b/CHANGES
index 7000d57f9..7f83b6903 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,11 +1,21 @@
+Changes with nginx 0.7.43 18 Mar 2009
+
+ *) Bugfix: a request was handled incorrectly, if a "root" directive
+ used variables; the bug had appeared in 0.7.42.
+
+ *) Bugfix: if a server listened on wildcard address, then the
+ $server_addr variable value was "0.0.0.0"; the bug had appeared in
+ 0.7.36.
+
+
Changes with nginx 0.7.42 16 Mar 2009
*) Change: now the "Invalid argument" error returned by
setsockopt(TCP_NODELAY) on Solaris, is ignored.
*) Change: now if a file specified in a "auth_basic_user_file"
- directive is absent, then the 405 error is returned instead of the
+ directive is absent, then the 403 error is returned instead of the
500 one.
*) Feature: the "auth_basic_user_file" directive supports variables.
diff --git a/CHANGES.ru b/CHANGES.ru
index d44de1157..10c5fabab 100644
--- a/CHANGES.ru
+++ b/CHANGES.ru
@@ -1,4 +1,13 @@
+Изменения в nginx 0.7.43 18.03.2009
+
+ *) Исправление: запрос обрабатывался неверно, если директива root
+ использовала переменные; ошибка появилась в 0.7.42.
+
+ *) Исправление: если сервер слушал на адресах типа "*", то значение
+ переменной $server_addr было "0.0.0.0"; ошибка появилась в 0.7.36.
+
+
Изменения в nginx 0.7.42 16.03.2009
*) Изменение: ошибка "Invalid argument", возвращаемая
diff --git a/src/core/nginx.h b/src/core/nginx.h
index cc0945b53..7d4e95259 100644
--- a/src/core/nginx.h
+++ b/src/core/nginx.h
@@ -8,7 +8,7 @@
#define _NGINX_H_INCLUDED_
-#define NGINX_VERSION "0.7.42"
+#define NGINX_VERSION "0.7.43"
#define NGINX_VER "nginx/" NGINX_VERSION
#define NGINX_VAR "NGINX"
diff --git a/src/http/modules/ngx_http_auth_basic_module.c b/src/http/modules/ngx_http_auth_basic_module.c
index 7506f7fbe..b288d95dc 100644
--- a/src/http/modules/ngx_http_auth_basic_module.c
+++ b/src/http/modules/ngx_http_auth_basic_module.c
@@ -470,11 +470,8 @@ ngx_http_auth_basic_user_file(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
ngx_str_t *value;
ngx_uint_t n;
- ngx_http_core_loc_conf_t *clcf;
ngx_http_script_compile_t sc;
- clcf = ngx_http_conf_get_module_loc_conf(cf, ngx_http_core_module);
-
if (alcf->user_file.data) {
return "is duplicate";
}
diff --git a/src/http/modules/perl/nginx.pm b/src/http/modules/perl/nginx.pm
index 9979a727a..a07a842d3 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.7.42';
+our $VERSION = '0.7.43';
require XSLoader;
XSLoader::load('nginx', $VERSION);
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index 66698d525..43d464418 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -1688,7 +1688,9 @@ ngx_http_map_uri_to_path(ngx_http_request_t *r, ngx_str_t *path,
last = ngx_copy(path->data, clcf->root.data, clcf->root.len);
} else {
- if (ngx_http_script_run(r, path, clcf->root_lengths->elts, ++reserved,
+ reserved += alias ? 1 : r->uri.len + 1;
+
+ if (ngx_http_script_run(r, path, clcf->root_lengths->elts, reserved,
clcf->root_values->elts)
== NULL)
{
@@ -1789,13 +1791,38 @@ ngx_http_auth_basic_user(ngx_http_request_t *r)
ngx_int_t
ngx_http_server_addr(ngx_http_request_t *r, ngx_str_t *s)
{
- socklen_t len;
- ngx_connection_t *c;
- u_char sa[NGX_SOCKADDRLEN];
+ socklen_t len;
+ ngx_uint_t addr;
+ ngx_connection_t *c;
+ u_char sa[NGX_SOCKADDRLEN];
+ struct sockaddr_in *sin;
+#if (NGX_HAVE_INET6)
+ ngx_uint_t i;
+ struct sockaddr_in6 *sin6;
+#endif
c = r->connection;
- if (c->local_sockaddr == NULL) {
+ switch (c->local_sockaddr->sa_family) {
+
+#if (NGX_HAVE_INET6)
+ case AF_INET6:
+ sin6 = (struct sockaddr_in6 *) c->local_sockaddr;
+
+ for (addr = 0, i = 0; addr == 0 && i < 16; i++) {
+ addr |= sin6->sin6_addr.s6_addr[i];
+ }
+
+ break;
+#endif
+
+ default: /* AF_INET */
+ sin = (struct sockaddr_in *) c->local_sockaddr;
+ addr = sin->sin_addr.s_addr;
+ break;
+ }
+
+ if (addr == 0) {
len = NGX_SOCKADDRLEN;
diff --git a/src/http/ngx_http_request.c b/src/http/ngx_http_request.c
index 0280c6380..c80ae101c 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -310,8 +310,6 @@ ngx_http_init_request(ngx_event_t *rev)
* is required to determine a server address
*/
- c->local_sockaddr = NULL;
-
if (ngx_http_server_addr(r, NULL) != NGX_OK) {
ngx_http_close_connection(c);
return;