comparison src/http/ngx_http_special_response.c @ 4935:7bd1c839af3b

Request body: improved handling of incorrect chunked request body. While discarding chunked request body in some cases after detecting request body corruption no error was returned, while it was possible to correctly return 400 Bad Request. If error is detected too late, make sure to properly close connection. Additionally, in ngx_http_special_response_handler() don't return body of 500 Internal Server Error to a client if ngx_http_discard_request_body() fails, but disable keepalive and continue.
author Maxim Dounin <mdounin@mdounin.ru>
date Mon, 26 Nov 2012 18:00:14 +0000
parents 812c4765c954
children 6b479db5b52b
comparison
equal deleted inserted replaced
4934:b61edaa04342 4935:7bd1c839af3b
419 } 419 }
420 420
421 r->expect_tested = 1; 421 r->expect_tested = 1;
422 422
423 if (ngx_http_discard_request_body(r) != NGX_OK) { 423 if (ngx_http_discard_request_body(r) != NGX_OK) {
424 error = NGX_HTTP_INTERNAL_SERVER_ERROR; 424 r->keepalive = 0;
425 } 425 }
426 426
427 if (clcf->msie_refresh 427 if (clcf->msie_refresh
428 && r->headers_in.msie 428 && r->headers_in.msie
429 && (error == NGX_HTTP_MOVED_PERMANENTLY 429 && (error == NGX_HTTP_MOVED_PERMANENTLY