aboutsummaryrefslogtreecommitdiff
path: root/src/http/ngx_http_core_module.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2003-11-10 21:09:22 +0000
committerIgor Sysoev <igor@sysoev.ru>2003-11-10 21:09:22 +0000
commitd59a047a7070dc6af13b2e35c097efccc8ce38d0 (patch)
tree7efbd7a8fd2e4d871da3165dab7287c49fb0341e /src/http/ngx_http_core_module.c
parent7832933eed3cb0187eca4fba87076f10c897925e (diff)
downloadnginx-d59a047a7070dc6af13b2e35c097efccc8ce38d0.tar.gz
nginx-d59a047a7070dc6af13b2e35c097efccc8ce38d0.zip
nginx-0.0.1-2003-11-11-00:09:22 import
Diffstat (limited to 'src/http/ngx_http_core_module.c')
-rw-r--r--src/http/ngx_http_core_module.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/http/ngx_http_core_module.c b/src/http/ngx_http_core_module.c
index a5f5c38ca..3a0ec8bfc 100644
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -429,6 +429,11 @@ int ngx_http_send_header(ngx_http_request_t *r)
return NGX_OK;
}
+ if (r->err_status) {
+ r->headers_out.status = r->err_status;
+ r->headers_out.status_line.len = 0;
+ }
+
return (*ngx_http_top_header_filter)(r);
}
@@ -495,7 +500,18 @@ int ngx_http_internal_redirect(ngx_http_request_t *r,
}
/* clear the modules contexts */
- ngx_memzero(r->ctx, sizeof(void *) * ngx_http_max_module);
+
+ if (r->error_page) {
+ r->err_status = r->headers_out.status;
+ r->err_ctx = r->ctx;
+ r->ctx = ngx_pcalloc(r->pool, sizeof(void *) * ngx_http_max_module);
+ if (r->ctx == NULL) {
+ return NGX_HTTP_INTERNAL_SERVER_ERROR;
+ }
+
+ } else {
+ ngx_memzero(r->ctx, sizeof(void *) * ngx_http_max_module);
+ }
r->phase = 0;
r->phase_handler = 0;