Mercurial > hg > nginx
comparison src/http/ngx_http_special_response.c @ 2322:d4df1c875351 stable-0.6
r2183, r2192 merge:
*) allow file existence test for POST requests in static module
*) do not discard body while error_page redirection
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Thu, 20 Nov 2008 17:07:22 +0000 |
parents | 3a00188e49c5 |
children | 6854b688fd77 |
comparison
equal
deleted
inserted
replaced
2321:2577098d65ac | 2322:d4df1c875351 |
---|---|
325 | 325 |
326 | 326 |
327 ngx_int_t | 327 ngx_int_t |
328 ngx_http_special_response_handler(ngx_http_request_t *r, ngx_int_t error) | 328 ngx_http_special_response_handler(ngx_http_request_t *r, ngx_int_t error) |
329 { | 329 { |
330 ngx_int_t rc; | |
331 ngx_uint_t i, err; | 330 ngx_uint_t i, err; |
332 ngx_http_err_page_t *err_page; | 331 ngx_http_err_page_t *err_page; |
333 ngx_http_core_loc_conf_t *clcf; | 332 ngx_http_core_loc_conf_t *clcf; |
334 | 333 |
335 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, | 334 ngx_log_debug2(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, |
336 "http special response: %d, \"%V\"", error, &r->uri); | 335 "http special response: %d, \"%V\"", error, &r->uri); |
337 | |
338 rc = ngx_http_discard_request_body(r); | |
339 | |
340 if (rc == NGX_HTTP_INTERNAL_SERVER_ERROR) { | |
341 error = NGX_HTTP_INTERNAL_SERVER_ERROR; | |
342 } | |
343 | 336 |
344 r->err_status = error; | 337 r->err_status = error; |
345 | 338 |
346 if (r->keepalive != 0) { | 339 if (r->keepalive != 0) { |
347 switch (error) { | 340 switch (error) { |
381 for (i = 0; i < clcf->error_pages->nelts; i++) { | 374 for (i = 0; i < clcf->error_pages->nelts; i++) { |
382 if (err_page[i].status == error) { | 375 if (err_page[i].status == error) { |
383 return ngx_http_send_error_page(r, &err_page[i]); | 376 return ngx_http_send_error_page(r, &err_page[i]); |
384 } | 377 } |
385 } | 378 } |
379 } | |
380 | |
381 if (ngx_http_discard_request_body(r) != NGX_OK) { | |
382 error = NGX_HTTP_INTERNAL_SERVER_ERROR; | |
386 } | 383 } |
387 | 384 |
388 if (clcf->msie_refresh | 385 if (clcf->msie_refresh |
389 && r->headers_in.msie | 386 && r->headers_in.msie |
390 && (error == NGX_HTTP_MOVED_PERMANENTLY | 387 && (error == NGX_HTTP_MOVED_PERMANENTLY |