mirror of
https://github.com/apache/httpd.git
synced 2025-08-08 15:02:10 +03:00
Correctly return 413 when an invalid chunk size is given on input.
- If get_chunk_size() returns a negative number, that probably implies an overflow. So, create a 413 error and pass it to the output filters. - Modify ap_discard_request_body() to return OK quickly if we're a subreq or our status code implies that we will be dropping the connection. - Modify ap_die() so that if the new status implies that we will drop the connection, that we correctly indicate that we can not keepalive this connection. (Without this, the error is returned, but the connection is not closed.) git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95331 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -139,13 +139,16 @@ AP_DECLARE(void) ap_die(int type, request_rec *r)
|
||||
r->status = HTTP_PROXY_AUTHENTICATION_REQUIRED;
|
||||
}
|
||||
|
||||
/*
|
||||
* If we want to keep the connection, be sure that the request body
|
||||
* (if any) has been read.
|
||||
/* If we don't want to keep the connection, make sure we mark that the
|
||||
* connection is not eligible for keepalive. If we want to keep the
|
||||
* connection, be sure that the request body (if any) has been read.
|
||||
*/
|
||||
if ((r->status != HTTP_NOT_MODIFIED) && (r->status != HTTP_NO_CONTENT)
|
||||
&& !ap_status_drops_connection(r->status)
|
||||
&& r->connection && (r->connection->keepalive != -1)) {
|
||||
if (ap_status_drops_connection(r->status)) {
|
||||
r->connection->keepalive = 0;
|
||||
}
|
||||
else if ((r->status != HTTP_NOT_MODIFIED) &&
|
||||
(r->status != HTTP_NO_CONTENT) &&
|
||||
r->connection && (r->connection->keepalive != -1)) {
|
||||
|
||||
(void) ap_discard_request_body(r);
|
||||
}
|
||||
|
Reference in New Issue
Block a user