summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2006-08-16 13:09:33 +0000
committerIgor Sysoev <igor@sysoev.ru>2006-08-16 13:09:33 +0000
commitef316430492ce988b71f2d2839c12e3d3922a66b (patch)
tree214292c0f152fd374940002499011024280097a8
parent2fb72a2205fd4a2bf450487032df43e5e1d9b14f (diff)
downloadnginx-ef316430492ce988b71f2d2839c12e3d3922a66b.tar.gz
nginx-0.3.59-RELEASE importrelease-0.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; the bug had appeared in 0.3.58.
-rw-r--r--auto/lib/md5/makefile.msvc6
-rw-r--r--auto/lib/sha1/makefile.msvc6
-rw-r--r--docs/xml/nginx/changes.xml36
-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.c6
-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, 62 insertions, 44 deletions
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/docs/xml/nginx/changes.xml b/docs/xml/nginx/changes.xml
index 0c0de897f..a2107508c 100644
--- a/docs/xml/nginx/changes.xml
+++ b/docs/xml/nginx/changes.xml
@@ -9,6 +9,42 @@
<title lang="en">nginx changelog</title>
+<changes ver="0.3.59" date="16.08.2006">
+
+<change type="feature">
+<para lang="ru">
+теперь можно делать несколько перенаправлений через директиву error_page.
+</para>
+<para lang="en">
+now is possible to do several redirection using the "error_page" directive.
+</para>
+</change>
+
+<change type="bugfix">
+<para lang="ru">
+директива dav_access не поддерживала три параметра.
+</para>
+<para lang="en">
+the "dav_access" directive did not support three parameters.
+</para>
+</change>
+
+<change type="bugfix">
+<para lang="ru">
+директива error_page не изменяла строку "Content-Type"
+после перенаправления с помощью "X-Accel-Redirect";
+ошибка появилась в 0.3.58.
+</para>
+<para lang="en">
+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.
+</para>
+</change>
+
+</changes>
+
+
<changes ver="0.3.58" date="14.08.2006">
<change type="feature">
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.c b/src/http/ngx_http_request.c
index 417f3dfa7..eb8b557b4 100644
--- a/src/http/ngx_http_request.c
+++ b/src/http/ngx_http_request.c
@@ -424,6 +424,9 @@ ngx_http_init_request(ngx_event_t *rev)
r->headers_out.content_length_n = -1;
r->headers_out.last_modified_time = -1;
+ r->uri_changes = NGX_HTTP_MAX_URI_CHANGES + 1;
+ r->subrequests = NGX_HTTP_MAX_SUBREQUESTS + 1;
+
r->http_state = NGX_HTTP_READING_REQUEST_STATE;
ctx = c->log->data;
@@ -667,9 +670,6 @@ ngx_http_process_request_line(ngx_event_t *rev)
c->write->handler = ngx_http_request_handler;
r->read_event_handler = ngx_http_block_read;
- r->uri_changes = NGX_HTTP_MAX_URI_CHANGES + 1;
- r->subrequests = NGX_HTTP_MAX_SUBREQUESTS + 1;
-
ngx_http_handler(r);
return;
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)