summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2006-08-16 13:07:35 +0000
committerJonathan Kolb <jon@b0g.us>2006-08-16 13:07:35 +0000
commitfc31d77ffaa5ab46c7b2306f0689cf25b83affb6 (patch)
tree61501e69297c7b86d4c503c16abf416f8f5be928
parent99c16dd2074483cbe9e36f7e1a60f940ff099758 (diff)
downloadnginx-fc31d77ffaa5ab46c7b2306f0689cf25b83affb6.tar.gz
Changes with nginx 0.3.59 16 Aug 2006v0.3.59
*) Feature: now is possible to do several redirection using the "error_page" directive. *) Bugfix: the "dav_access" directive did not support three parameters. *) Bugfix: the "error_page" directive did not changes the "Content-Type" header line after the "X-Accel-Redirect" was used; bug appeared in 0.3.58.
-rw-r--r--CHANGES12
-rw-r--r--CHANGES.ru12
-rw-r--r--auto/lib/md5/makefile.msvc6
-rw-r--r--auto/lib/sha1/makefile.msvc6
-rw-r--r--src/core/nginx.h2
-rw-r--r--src/http/modules/ngx_http_dav_module.c2
-rw-r--r--src/http/modules/ngx_http_memcached_module.c2
-rw-r--r--src/http/ngx_http.h8
-rw-r--r--src/http/ngx_http_core_module.c19
-rw-r--r--src/http/ngx_http_request.h1
-rw-r--r--src/http/ngx_http_special_response.c8
-rw-r--r--src/http/ngx_http_upstream.c8
-rw-r--r--src/http/ngx_http_upstream.h2
13 files changed, 47 insertions, 41 deletions
diff --git a/CHANGES b/CHANGES
index 81a6795f2..644053ee8 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,4 +1,16 @@
+Changes with nginx 0.3.59 16 Aug 2006
+
+ *) Feature: now is possible to do several redirection using the
+ "error_page" directive.
+
+ *) Bugfix: the "dav_access" directive did not support three parameters.
+
+ *) Bugfix: the "error_page" directive did not changes the
+ "Content-Type" header line after the "X-Accel-Redirect" was used;
+ bug appeared in 0.3.58.
+
+
Changes with nginx 0.3.58 14 Aug 2006
*) Feature: the "error_page" directive supports the variables.
diff --git a/CHANGES.ru b/CHANGES.ru
index 0b7a31f3b..3e67640c8 100644
--- a/CHANGES.ru
+++ b/CHANGES.ru
@@ -1,4 +1,16 @@
+Изменения в nginx 0.3.59 16.08.2006
+
+ *) Добавление: теперь можно делать несколько перенаправлений через
+ директиву error_page.
+
+ *) Исправление: директива dav_access не поддерживала три параметра.
+
+ *) Исправление: директива error_page не изменяла строку "Content-Type"
+ после перенаправления с помощью "X-Accel-Redirect"; ошибка появилась
+ в 0.3.58.
+
+
Изменения в nginx 0.3.58 14.08.2006
*) Добавление: директива error_page поддерживает переменные.
diff --git a/auto/lib/md5/makefile.msvc b/auto/lib/md5/makefile.msvc
index aaffe1889..2798d6512 100644
--- a/auto/lib/md5/makefile.msvc
+++ b/auto/lib/md5/makefile.msvc
@@ -4,16 +4,16 @@
CFLAGS = -nologo -O2 -Ob1 -Oi -Gs $(LIBC) $(CPU_OPT) -D L_ENDIAN
-!if "$(MD5_ASM)" == "YES"
+!IF "$(MD5_ASM)" == "YES"
md5.lib:
cl -c $(CFLAGS) -D MD5_ASM md5_dgst.c
link -lib -out:md5.lib md5_dgst.obj asm/m-win32.obj
-!else
+!ELSE
md5.lib:
cl -c $(CFLAGS) md5_dgst.c
link -lib -out:md5.lib md5_dgst.obj
-!endif
+!ENDIF
diff --git a/auto/lib/sha1/makefile.msvc b/auto/lib/sha1/makefile.msvc
index 2ec55d5a8..929e4622b 100644
--- a/auto/lib/sha1/makefile.msvc
+++ b/auto/lib/sha1/makefile.msvc
@@ -4,16 +4,16 @@
CFLAGS = -nologo -O2 -Ob1 -Oi -Gs $(LIBC) $(CPU_OPT) -D L_ENDIAN
-!if "$(SHA1_ASM)" == "YES"
+!IF "$(SHA1_ASM)" == "YES"
sha1.lib:
cl -c $(CFLAGS) -D SHA1_ASM sha1dgst.c
link -lib -out:sha1.lib sha1dgst.obj asm/s-win32.obj
-!else
+!ELSE
sha1.lib:
cl -c $(CFLAGS) sha1dgst.c
link -lib -out:sha1.lib sha1dgst.obj
-!endif
+!ENDIF
diff --git a/src/core/nginx.h b/src/core/nginx.h
index b7c0d084f..224fb70f8 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.58"
+#define NGINX_VER "nginx/0.3.59"
#define NGINX_VAR "NGINX"
#define NGX_OLDPID_EXT ".oldbin"
diff --git a/src/http/modules/ngx_http_dav_module.c b/src/http/modules/ngx_http_dav_module.c
index 990138607..8bede73af 100644
--- a/src/http/modules/ngx_http_dav_module.c
+++ b/src/http/modules/ngx_http_dav_module.c
@@ -57,7 +57,7 @@ static ngx_command_t ngx_http_dav_commands[] = {
NULL },
{ ngx_string("dav_access"),
- NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE12,
+ NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE123,
ngx_http_dav_access,
NGX_HTTP_LOC_CONF_OFFSET,
0,
diff --git a/src/http/modules/ngx_http_memcached_module.c b/src/http/modules/ngx_http_memcached_module.c
index 61a9502f0..bb5ab5d0a 100644
--- a/src/http/modules/ngx_http_memcached_module.c
+++ b/src/http/modules/ngx_http_memcached_module.c
@@ -526,7 +526,7 @@ ngx_http_memcached_create_loc_conf(ngx_conf_t *cf)
conf->upstream.max_temp_file_size = 0;
conf->upstream.temp_file_write_size = 0;
conf->upstream.intercept_errors = 1;
- conf->upstream.redirect_404 = 1;
+ conf->upstream.intercept_404 = 1;
conf->upstream.pass_request_headers = 0;
conf->upstream.pass_request_body = 0;
diff --git a/src/http/ngx_http.h b/src/http/ngx_http.h
index 41720f24a..74ebfc7d1 100644
--- a/src/http/ngx_http.h
+++ b/src/http/ngx_http.h
@@ -53,12 +53,8 @@ struct ngx_http_log_ctx_s {
};
-#define ngx_http_get_module_ctx(r, module) (r)->ctx[module.ctx_index]
-#define ngx_http_get_module_err_ctx(r, module) \
- ((r)->err_ctx ? (r)->err_ctx[module.ctx_index] : (r)->ctx[module.ctx_index])
-
-#define ngx_http_set_ctx(r, c, module) r->ctx[module.ctx_index] = c;
-#define ngx_http_delete_ctx(r, module) r->ctx[module.ctx_index] = NULL;
+#define ngx_http_get_module_ctx(r, module) (r)->ctx[module.ctx_index]
+#define ngx_http_set_ctx(r, c, module) r->ctx[module.ctx_index] = c;
void ngx_http_init_connection(ngx_connection_t *c);
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index 764f35c57..b28931757 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -464,7 +464,7 @@ ngx_http_handler(ngx_http_request_t *r)
r->connection->unexpected_eof = 0;
- if (r->err_ctx == NULL) {
+ if (!r->internal) {
switch (r->headers_in.connection_type) {
case 0:
if (r->http_version > NGX_HTTP_VERSION_10) {
@@ -1341,21 +1341,8 @@ ngx_http_internal_redirect(ngx_http_request_t *r,
return NGX_HTTP_INTERNAL_SERVER_ERROR;
}
- if (r->err_ctx) {
-
- /* allocate the new module's contexts */
-
- r->ctx = ngx_pcalloc(r->pool, sizeof(void *) * ngx_http_max_module);
- if (r->ctx == NULL) {
- return NGX_HTTP_INTERNAL_SERVER_ERROR;
- }
-
- } else {
-
- /* clear the modules contexts */
-
- ngx_memzero(r->ctx, sizeof(void *) * ngx_http_max_module);
- }
+ /* clear the modules contexts */
+ ngx_memzero(r->ctx, sizeof(void *) * ngx_http_max_module);
cscf = ngx_http_get_module_srv_conf(r, ngx_http_core_module);
r->loc_conf = cscf->ctx->loc_conf;
diff --git a/src/http/ngx_http_request.h b/src/http/ngx_http_request.h
index fa8fd0fca..74be0f73d 100644
--- a/src/http/ngx_http_request.h
+++ b/src/http/ngx_http_request.h
@@ -368,7 +368,6 @@ struct ngx_http_request_s {
off_t request_length;
- void **err_ctx;
ngx_uint_t err_status;
ngx_http_connection_t *http_connection;
diff --git a/src/http/ngx_http_special_response.c b/src/http/ngx_http_special_response.c
index dfff64107..abdf62482 100644
--- a/src/http/ngx_http_special_response.c
+++ b/src/http/ngx_http_special_response.c
@@ -336,9 +336,11 @@ ngx_http_special_response_handler(ngx_http_request_t *r, ngx_int_t error)
}
}
+ r->headers_out.content_type.len = 0;
+
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
- if (r->err_ctx == NULL && clcf->error_pages) {
+ if (clcf->error_pages) {
err_page = clcf->error_pages->elts;
@@ -346,7 +348,6 @@ ngx_http_special_response_handler(ngx_http_request_t *r, ngx_int_t error)
if (err_page[i].status == error) {
r->err_status = err_page[i].overwrite;
- r->err_ctx = r->ctx;
r->method = NGX_HTTP_GET;
@@ -370,9 +371,10 @@ ngx_http_special_response_handler(ngx_http_request_t *r, ngx_int_t error)
ngx_list_push(&r->headers_out.headers);
if (r->headers_out.location) {
- r->err_status = NGX_HTTP_MOVED_TEMPORARILY;
error = NGX_HTTP_MOVED_TEMPORARILY;
+ r->err_status = NGX_HTTP_MOVED_TEMPORARILY;
+
r->headers_out.location->hash = 1;
r->headers_out.location->key.len = sizeof("Location") - 1;
r->headers_out.location->key.data = (u_char *) "Location";
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c
index d5b7aee53..cede08d27 100644
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -1093,17 +1093,15 @@ ngx_http_upstream_process_header(ngx_event_t *rev)
return;
}
- if (u->conf->redirect_404) {
- rc = (r->err_ctx == NULL) ? 404 : 204;
- ngx_http_upstream_finalize_request(r, u, rc);
+ if (u->conf->intercept_404) {
+ ngx_http_upstream_finalize_request(r, u, NGX_HTTP_NOT_FOUND);
return;
}
}
if (u->headers_in.status_n >= NGX_HTTP_BAD_REQUEST
- && u->conf->intercept_errors
- && r->err_ctx == NULL)
+ && u->conf->intercept_errors)
{
clcf = ngx_http_get_module_loc_conf(r, ngx_http_core_module);
diff --git a/src/http/ngx_http_upstream.h b/src/http/ngx_http_upstream.h
index 8c2a90193..98319463d 100644
--- a/src/http/ngx_http_upstream.h
+++ b/src/http/ngx_http_upstream.h
@@ -103,7 +103,7 @@ typedef struct {
ngx_str_t location;
ngx_str_t url; /* used in proxy_rewrite_location */
- unsigned redirect_404:1;
+ unsigned intercept_404:1;
unsigned change_buffering:1;
#if (NGX_HTTP_SSL)