Mercurial > hg > nginx-quic
comparison src/http/ngx_http_special_response.c @ 88:674d333f4296
nginx-0.0.1-2003-05-14-21:13:13 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 14 May 2003 17:13:13 +0000 |
parents | 59229033ae93 |
children | a23d010f356d |
comparison
equal
deleted
inserted
replaced
87:5f6d848dcbef | 88:674d333f4296 |
---|---|
118 len = 0; | 118 len = 0; |
119 | 119 |
120 r->headers_out.status = error; | 120 r->headers_out.status = error; |
121 | 121 |
122 if (error < NGX_HTTP_BAD_REQUEST) { | 122 if (error < NGX_HTTP_BAD_REQUEST) { |
123 /* 3XX */ | |
123 err = error - NGX_HTTP_MOVED_PERMANENTLY; | 124 err = error - NGX_HTTP_MOVED_PERMANENTLY; |
124 | 125 |
125 } else { | 126 } else { |
126 ngx_test_null(r->headers_out.content_type, | 127 ngx_test_null(r->headers_out.content_type, |
127 ngx_push_table(r->headers_out.headers), | 128 ngx_push_table(r->headers_out.headers), |
131 r->headers_out.content_type->key.data = "Content-Type"; | 132 r->headers_out.content_type->key.data = "Content-Type"; |
132 r->headers_out.content_type->value.len = 9; | 133 r->headers_out.content_type->value.len = 9; |
133 r->headers_out.content_type->value.data = "text/html"; | 134 r->headers_out.content_type->value.data = "text/html"; |
134 | 135 |
135 if (error < NGX_HTTP_INTERNAL_SERVER_ERROR) { | 136 if (error < NGX_HTTP_INTERNAL_SERVER_ERROR) { |
137 /* 4XX */ | |
136 err = error - NGX_HTTP_BAD_REQUEST + 3; | 138 err = error - NGX_HTTP_BAD_REQUEST + 3; |
137 | 139 |
138 } else { | 140 } else { |
141 /* 5XX */ | |
139 err = error - NGX_HTTP_INTERNAL_SERVER_ERROR + 3 + 17; | 142 err = error - NGX_HTTP_INTERNAL_SERVER_ERROR + 3 + 17; |
140 } | 143 } |
141 } | 144 } |
142 | 145 |
143 if (r->keepalive != 0) { | 146 if (r->keepalive != 0) { |
144 switch (error) { | 147 switch (error) { |
145 case NGX_HTTP_BAD_REQUEST: | 148 case NGX_HTTP_BAD_REQUEST: |
146 case NGX_HTTP_REQUEST_URI_TOO_LARGE: | 149 case NGX_HTTP_REQUEST_URI_TOO_LARGE: |
147 case NGX_HTTP_INTERNAL_SERVER_ERROR: | 150 case NGX_HTTP_INTERNAL_SERVER_ERROR: |
148 r->keepalive = 0; | 151 r->keepalive = 0; |
152 } | |
153 } | |
154 | |
155 if (r->lingering_close == 1) { | |
156 switch (error) { | |
157 case NGX_HTTP_BAD_REQUEST: | |
158 case NGX_HTTP_REQUEST_URI_TOO_LARGE: | |
159 case NGX_HTTP_INTERNAL_SERVER_ERROR: | |
160 r->lingering_close = 0; | |
149 } | 161 } |
150 } | 162 } |
151 | 163 |
152 if (error_pages[err].len == 0) { | 164 if (error_pages[err].len == 0) { |
153 r->headers_out.content_length = -1; | 165 r->headers_out.content_length = -1; |