- 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
* 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))
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;
+ }
}
/*