we would lose the extra filters. Now, if a filter is added, it is run.
Unfortunately, this can cause an infinite loop, or it can cause request
headers to appear twice. This commit removes two instances in the core
where we were inserting filters for a second and third time. The bug
was that error responses were causing infinite loops.
This also removes the reset_filters function, which did the exact
same thing as add_required_filters. The two functions were both called
in error conditions, which was part of what caused this bug.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93693
13f79535-47bb-0310-9956-
ffa450edef68
static void ap_http_insert_filter(request_rec *r)
{
- if (!r->main) {
+ if (!r->main && !r->prev) {
ap_add_output_filter_handle(ap_byterange_filter_handle,
NULL, r, r->connection);
ap_add_output_filter_handle(ap_content_length_filter_handle,
}
}
-static void reset_filters(request_rec *r)
-{
- /* only reset request level filters,
- * connection level filters need to remain in tact
- */
- r->output_filters = r->connection->output_filters;
- ap_add_output_filter("CONTENT_LENGTH", NULL, r, r->connection);
- ap_add_output_filter("HTTP_HEADER", NULL, r, r->connection);
-}
-
/* We should have named this send_canned_response, since it is used for any
* response that can be generated by the server from the request record.
* This includes all 204 (no content), 3xx (redirect), 4xx (client error),
* this value.
*/
r->eos_sent = 0;
- reset_filters(r);
/*
* It's possible that the Location field might be in r->err_headers_out