diff options
author | Igor Sysoev <igor@sysoev.ru> | 2003-05-14 17:13:13 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2003-05-14 17:13:13 +0000 |
commit | 79a804880ee362a1256e6e8aeadb73f7f5cf0885 (patch) | |
tree | 72ab5081ebb0a198288f706be81defbb4664e5ae /src/http/ngx_http_special_response.c | |
parent | d581fd58e11724df8d7a9d748f9fc3ab66911a5f (diff) | |
download | nginx-79a804880ee362a1256e6e8aeadb73f7f5cf0885.tar.gz nginx-79a804880ee362a1256e6e8aeadb73f7f5cf0885.zip |
nginx-0.0.1-2003-05-14-21:13:13 import
Diffstat (limited to 'src/http/ngx_http_special_response.c')
-rw-r--r-- | src/http/ngx_http_special_response.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/http/ngx_http_special_response.c b/src/http/ngx_http_special_response.c index 6213c4f08..8c86b2437 100644 --- a/src/http/ngx_http_special_response.c +++ b/src/http/ngx_http_special_response.c @@ -120,6 +120,7 @@ int ngx_http_special_response_handler(ngx_http_request_t *r, int error) r->headers_out.status = error; if (error < NGX_HTTP_BAD_REQUEST) { + /* 3XX */ err = error - NGX_HTTP_MOVED_PERMANENTLY; } else { @@ -133,9 +134,11 @@ int ngx_http_special_response_handler(ngx_http_request_t *r, int error) r->headers_out.content_type->value.data = "text/html"; if (error < NGX_HTTP_INTERNAL_SERVER_ERROR) { + /* 4XX */ err = error - NGX_HTTP_BAD_REQUEST + 3; } else { + /* 5XX */ err = error - NGX_HTTP_INTERNAL_SERVER_ERROR + 3 + 17; } } @@ -149,6 +152,15 @@ int ngx_http_special_response_handler(ngx_http_request_t *r, int error) } } + if (r->lingering_close == 1) { + switch (error) { + case NGX_HTTP_BAD_REQUEST: + case NGX_HTTP_REQUEST_URI_TOO_LARGE: + case NGX_HTTP_INTERNAL_SERVER_ERROR: + r->lingering_close = 0; + } + } + if (error_pages[err].len == 0) { r->headers_out.content_length = -1; } else { |