1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-07 04:02:58 +03:00

Fix the case where we generate both a 401 and 413 and we go bonkers.

- If an error would drop the connection, we do not return the top-level
  error anymore as we will assume this new one takes precedence over the
  original error.  This also ensures that we will not read the input
  body (which is the point of returning these special error messages in
  the first place).
- The ap_discard_request_body return value in ap_die() must be checked
  to make sure we don't encounter this recursive case and print two errors.

Kudos to Jeff Trawick for his sample input which pointed this out.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95426 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Justin Erenkrantz
2002-05-31 07:37:19 +00:00
parent 2f171d8fd4
commit 0186760562

View File

@@ -117,8 +117,7 @@ AP_DECLARE(void) ap_die(int type, request_rec *r)
* error condition, we just report on the original error, and give up on
* any attempt to handle the other thing "intelligently"...
*/
if (r->status != HTTP_OK) {
if (r->status != HTTP_OK && !ap_status_drops_connection(type)) {
recursive_error = type;
while (r->prev && (r->prev->status != HTTP_OK))
@@ -149,8 +148,13 @@ AP_DECLARE(void) ap_die(int type, request_rec *r)
else if ((r->status != HTTP_NOT_MODIFIED) &&
(r->status != HTTP_NO_CONTENT) &&
r->connection && (r->connection->keepalive != -1)) {
(void) ap_discard_request_body(r);
/* If the discard returns AP_FILTER_ERROR, it means that we went
* recursive on ourselves and we should abort.
*/
int errstatus = ap_discard_request_body(r);
if (errstatus == AP_FILTER_ERROR) {
return;
}
}
/*