summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2010-01-11 15:35:50 +0000
committerJonathan Kolb <jon@b0g.us>2010-01-11 15:35:50 +0000
commitf77e83cd92849af4a6226406c8e2cfa8e18722d4 (patch)
treea104847e1c6485b7d8dd27df5f41bfe680f69ca3
parent1076a3b56dad584003f1f1429c139a1069620dfc (diff)
downloadnginx-f77e83cd92849af4a6226406c8e2cfa8e18722d4.tar.gz
Changes with nginx 0.8.32 11 Jan 2010v0.8.32
*) Bugfix: UTF-8 encoding usage in the ngx_http_autoindex_module. Thanks to Maxim Dounin. *) Bugfix: regular expression named captures worked for two names only. Thanks to Maxim Dounin. *) Bugfix: now the "localhost" name is used in the "Host" request header line, if an unix domain socket is defined in the "auth_http" directive. Thanks to Maxim Dounin. *) Bugfix: nginx did nor support chunked transfer encoding for 201 responses. Thanks to Julian Reich. *) Bugfix: if the "expires modified" set date in the past, the a negative number was set in the "Cache-Control" response header line. Thanks to Alex Kapranoff.
-rw-r--r--CHANGES23
-rw-r--r--CHANGES.ru25
-rw-r--r--LICENSE2
-rw-r--r--src/core/nginx.h4
-rw-r--r--src/core/ngx_resolver.c54
-rw-r--r--src/core/ngx_resolver.h2
-rw-r--r--src/core/ngx_string.c4
-rw-r--r--src/http/modules/ngx_http_chunked_filter_module.c1
-rw-r--r--src/http/modules/ngx_http_headers_filter_module.c2
-rw-r--r--src/http/modules/perl/nginx.pm2
-rw-r--r--src/http/ngx_http_variables.c2
-rw-r--r--src/mail/ngx_mail_auth_http_module.c9
12 files changed, 105 insertions, 25 deletions
diff --git a/CHANGES b/CHANGES
index 314bfb5e0..a4aca1342 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,27 @@
+Changes with nginx 0.8.32 11 Jan 2010
+
+ *) Bugfix: UTF-8 encoding usage in the ngx_http_autoindex_module.
+ Thanks to Maxim Dounin.
+
+ *) Bugfix: regular expression named captures worked for two names only.
+ Thanks to Maxim Dounin.
+
+ *) Bugfix: now the "localhost" name is used in the "Host" request
+ header line, if an unix domain socket is defined in the "auth_http"
+ directive.
+ Thanks to Maxim Dounin.
+
+ *) Bugfix: nginx did nor support chunked transfer encoding for 201
+ responses.
+ Thanks to Julian Reich.
+
+ *) Bugfix: if the "expires modified" set date in the past, the a
+ negative number was set in the "Cache-Control" response header
+ line.
+ Thanks to Alex Kapranoff.
+
+
Changes with nginx 0.8.31 23 Dec 2009
*) Feature: now the "error_page" directive may redirect the 301 and 302
diff --git a/CHANGES.ru b/CHANGES.ru
index 61fd6bdb1..b5d1b533b 100644
--- a/CHANGES.ru
+++ b/CHANGES.ru
@@ -1,4 +1,29 @@
+Изменения в nginx 0.8.32 11.01.2010
+
+ *) Исправление: ошибки при использовании кодировки UTF-8 в
+ ngx_http_autoindex_module.
+ Спасибо Максиму Дунину.
+
+ *) Исправление: именованные выделения в регулярных выражениях работали
+ только для двух переменных.
+ Спасибо Максиму Дунину.
+
+ *) Исправление: теперь в строке заголовка запроса "Host" используется
+ имя "localhost", если в директиве auth_http указан unix domain
+ сокет.
+ Спасибо Максиму Дунину.
+
+ *) Исправление: nginx не поддерживал передачу chunk'ами для 201-ых
+ ответов.
+ Спасибо Julian Reich.
+
+ *) Исправление: если директива "expires modified" выставляла дату в
+ прошлом, то в строке заголовка ответа "Cache-Control" выдавалось
+ отрицательное число.
+ Спасибо Алексею Капранову.
+
+
Изменения в nginx 0.8.31 23.12.2009
*) Добавление: теперь директива error_page может перенаправлять ответы
diff --git a/LICENSE b/LICENSE
index d941ed9fb..77a6c11bb 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2002-2009 Igor Sysoev
+ * Copyright (C) 2002-2010 Igor Sysoev
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
diff --git a/src/core/nginx.h b/src/core/nginx.h
index 948fc0731..c74812119 100644
--- a/src/core/nginx.h
+++ b/src/core/nginx.h
@@ -8,8 +8,8 @@
#define _NGINX_H_INCLUDED_
-#define nginx_version 8031
-#define NGINX_VERSION "0.8.31"
+#define nginx_version 8032
+#define NGINX_VERSION "0.8.32"
#define NGINX_VER "nginx/" NGINX_VERSION
#define NGINX_VAR "NGINX"
diff --git a/src/core/ngx_resolver.c b/src/core/ngx_resolver.c
index 1549cb51a..a2b557062 100644
--- a/src/core/ngx_resolver.c
+++ b/src/core/ngx_resolver.c
@@ -87,6 +87,7 @@ static void *ngx_resolver_calloc(ngx_resolver_t *r, size_t size);
static void ngx_resolver_free(ngx_resolver_t *r, void *p);
static void ngx_resolver_free_locked(ngx_resolver_t *r, void *p);
static void *ngx_resolver_dup(ngx_resolver_t *r, void *src, size_t size);
+static u_char *ngx_resolver_log_error(ngx_log_t *log, u_char *buf, size_t len);
ngx_resolver_t *
@@ -150,7 +151,11 @@ ngx_resolver_create(ngx_conf_t *cf, ngx_addr_t *addr)
uc->sockaddr = addr->sockaddr;
uc->socklen = addr->socklen;
uc->server = addr->name;
- uc->log = &cf->cycle->new_log;
+
+ uc->log = cf->cycle->new_log;
+ uc->log.handler = ngx_resolver_log_error;
+ uc->log.data = uc;
+ uc->log.action = "resolving";
}
return r;
@@ -840,7 +845,7 @@ ngx_resolver_send_query(ngx_resolver_t *r, ngx_resolver_node_t *rn)
}
if ((size_t) n != (size_t) rn->qlen) {
- ngx_log_error(NGX_LOG_CRIT, uc->log, 0, "send() incomplete");
+ ngx_log_error(NGX_LOG_CRIT, &uc->log, 0, "send() incomplete");
return NGX_ERROR;
}
@@ -2071,6 +2076,29 @@ ngx_resolver_strerror(ngx_int_t err)
}
+static u_char *
+ngx_resolver_log_error(ngx_log_t *log, u_char *buf, size_t len)
+{
+ u_char *p;
+ ngx_udp_connection_t *uc;
+
+ p = buf;
+
+ if (log->action) {
+ p = ngx_snprintf(buf, len, " while %s", log->action);
+ len -= p - buf;
+ }
+
+ uc = log->data;
+
+ if (uc) {
+ p = ngx_snprintf(p, len, ", resolver: %V", &uc->server);
+ }
+
+ return p;
+}
+
+
ngx_int_t
ngx_udp_connect(ngx_udp_connection_t *uc)
{
@@ -2082,19 +2110,19 @@ ngx_udp_connect(ngx_udp_connection_t *uc)
s = ngx_socket(AF_INET, SOCK_DGRAM, 0);
- ngx_log_debug1(NGX_LOG_DEBUG_EVENT, uc->log, 0, "UDP socket %d", s);
+ ngx_log_debug1(NGX_LOG_DEBUG_EVENT, &uc->log, 0, "UDP socket %d", s);
if (s == -1) {
- ngx_log_error(NGX_LOG_ALERT, uc->log, ngx_socket_errno,
+ ngx_log_error(NGX_LOG_ALERT, &uc->log, ngx_socket_errno,
ngx_socket_n " failed");
return NGX_ERROR;
}
- c = ngx_get_connection(s, uc->log);
+ c = ngx_get_connection(s, &uc->log);
if (c == NULL) {
if (ngx_close_socket(s) == -1) {
- ngx_log_error(NGX_LOG_ALERT, uc->log, ngx_socket_errno,
+ ngx_log_error(NGX_LOG_ALERT, &uc->log, ngx_socket_errno,
ngx_close_socket_n "failed");
}
@@ -2102,13 +2130,13 @@ ngx_udp_connect(ngx_udp_connection_t *uc)
}
if (ngx_nonblocking(s) == -1) {
- ngx_log_error(NGX_LOG_ALERT, uc->log, ngx_socket_errno,
+ ngx_log_error(NGX_LOG_ALERT, &uc->log, ngx_socket_errno,
ngx_nonblocking_n " failed");
ngx_free_connection(c);
if (ngx_close_socket(s) == -1) {
- ngx_log_error(NGX_LOG_ALERT, uc->log, ngx_socket_errno,
+ ngx_log_error(NGX_LOG_ALERT, &uc->log, ngx_socket_errno,
ngx_close_socket_n " failed");
}
@@ -2118,8 +2146,8 @@ ngx_udp_connect(ngx_udp_connection_t *uc)
rev = c->read;
wev = c->write;
- rev->log = uc->log;
- wev->log = uc->log;
+ rev->log = &uc->log;
+ wev->log = &uc->log;
uc->connection = c;
@@ -2136,7 +2164,7 @@ ngx_udp_connect(ngx_udp_connection_t *uc)
#endif
- ngx_log_debug3(NGX_LOG_DEBUG_EVENT, uc->log, 0,
+ ngx_log_debug3(NGX_LOG_DEBUG_EVENT, &uc->log, 0,
"connect to %V, fd:%d #%d", &uc->server, s, c->number);
rc = connect(s, uc->sockaddr, uc->socklen);
@@ -2144,8 +2172,8 @@ ngx_udp_connect(ngx_udp_connection_t *uc)
/* TODO: aio, iocp */
if (rc == -1) {
- ngx_log_error(NGX_LOG_CRIT, uc->log, ngx_socket_errno,
- "connect() to %V failed", &uc->server);
+ ngx_log_error(NGX_LOG_CRIT, &uc->log, ngx_socket_errno,
+ "connect() failed");
return NGX_ERROR;
}
diff --git a/src/core/ngx_resolver.h b/src/core/ngx_resolver.h
index 3e7c388da..ef3c2082c 100644
--- a/src/core/ngx_resolver.h
+++ b/src/core/ngx_resolver.h
@@ -37,7 +37,7 @@ typedef struct {
struct sockaddr *sockaddr;
socklen_t socklen;
ngx_str_t server;
- ngx_log_t *log;
+ ngx_log_t log;
} ngx_udp_connection_t;
diff --git a/src/core/ngx_string.c b/src/core/ngx_string.c
index 613ce93b8..829913483 100644
--- a/src/core/ngx_string.c
+++ b/src/core/ngx_string.c
@@ -1239,10 +1239,8 @@ ngx_utf8_cpystrn(u_char *dst, u_char *src, size_t n, size_t len)
break;
}
- len--;
-
while (src < next) {
- *++dst = *++src;
+ *dst++ = *src++;
len--;
}
}
diff --git a/src/http/modules/ngx_http_chunked_filter_module.c b/src/http/modules/ngx_http_chunked_filter_module.c
index 846053ff4..25b7fe8e8 100644
--- a/src/http/modules/ngx_http_chunked_filter_module.c
+++ b/src/http/modules/ngx_http_chunked_filter_module.c
@@ -52,7 +52,6 @@ ngx_http_chunked_header_filter(ngx_http_request_t *r)
{
if (r->headers_out.status == NGX_HTTP_NOT_MODIFIED
|| r->headers_out.status == NGX_HTTP_NO_CONTENT
- || r->headers_out.status == NGX_HTTP_CREATED
|| r != r->main
|| (r->method & NGX_HTTP_HEAD))
{
diff --git a/src/http/modules/ngx_http_headers_filter_module.c b/src/http/modules/ngx_http_headers_filter_module.c
index 3b5ebd68f..fb6c0050e 100644
--- a/src/http/modules/ngx_http_headers_filter_module.c
+++ b/src/http/modules/ngx_http_headers_filter_module.c
@@ -291,7 +291,7 @@ ngx_http_set_expires(ngx_http_request_t *r, ngx_http_headers_conf_t *conf)
ngx_http_time(expires->value.data, expires_time);
- if (conf->expires_time < 0) {
+ if (conf->expires_time < 0 || max_age < 0) {
cc->value.len = sizeof("no-cache") - 1;
cc->value.data = (u_char *) "no-cache";
diff --git a/src/http/modules/perl/nginx.pm b/src/http/modules/perl/nginx.pm
index f6ba78b9a..caa10abde 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.31';
+our $VERSION = '0.8.32';
require XSLoader;
XSLoader::load('nginx', $VERSION);
diff --git a/src/http/ngx_http_variables.c b/src/http/ngx_http_variables.c
index 0231d6727..150c4e2be 100644
--- a/src/http/ngx_http_variables.c
+++ b/src/http/ngx_http_variables.c
@@ -1743,7 +1743,7 @@ ngx_http_regex_compile(ngx_conf_t *cf, ngx_regex_compile_t *rc)
v->get_handler = ngx_http_variable_not_found;
- p += i + size;
+ p += size;
}
return re;
diff --git a/src/mail/ngx_mail_auth_http_module.c b/src/mail/ngx_mail_auth_http_module.c
index c755c7221..b9f963578 100644
--- a/src/mail/ngx_mail_auth_http_module.c
+++ b/src/mail/ngx_mail_auth_http_module.c
@@ -1405,7 +1405,14 @@ ngx_mail_auth_http(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
ahcf->peer = u.addrs;
- ahcf->host_header = u.host;
+ if (u.family != AF_UNIX) {
+ ahcf->host_header = u.host;
+
+ } else {
+ ahcf->host_header.len = sizeof("localhost") - 1;
+ ahcf->host_header.data = (u_char *) "localhost";
+ }
+
ahcf->uri = u.uri;
if (ahcf->uri.len == 0) {