comparison src/http/ngx_http_special_response.c @ 2191:808547aa8c12

do not discard body while error_page redirection
author Igor Sysoev <igor@sysoev.ru>
date Tue, 19 Aug 2008 12:23:18 +0000
parents 20a7fc523aec
children 798ecc4fe75c
comparison
equal deleted inserted replaced
2190:f06bb6d8bc49 2191:808547aa8c12
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_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, 334 ngx_log_debug3(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
336 "http special response: %d, \"%V?%V\"", 335 "http special response: %d, \"%V?%V\"",
337 error, &r->uri, &r->args); 336 error, &r->uri, &r->args);
338
339 rc = ngx_http_discard_request_body(r);
340
341 if (rc == NGX_HTTP_INTERNAL_SERVER_ERROR) {
342 error = NGX_HTTP_INTERNAL_SERVER_ERROR;
343 }
344 337
345 r->err_status = error; 338 r->err_status = error;
346 339
347 if (r->keepalive) { 340 if (r->keepalive) {
348 switch (error) { 341 switch (error) {
382 for (i = 0; i < clcf->error_pages->nelts; i++) { 375 for (i = 0; i < clcf->error_pages->nelts; i++) {
383 if (err_page[i].status == error) { 376 if (err_page[i].status == error) {
384 return ngx_http_send_error_page(r, &err_page[i]); 377 return ngx_http_send_error_page(r, &err_page[i]);
385 } 378 }
386 } 379 }
380 }
381
382 if (ngx_http_discard_request_body(r) != NGX_OK) {
383 error = NGX_HTTP_INTERNAL_SERVER_ERROR;
387 } 384 }
388 385
389 if (clcf->msie_refresh 386 if (clcf->msie_refresh
390 && r->headers_in.msie 387 && r->headers_in.msie
391 && (error == NGX_HTTP_MOVED_PERMANENTLY 388 && (error == NGX_HTTP_MOVED_PERMANENTLY