Commit 8cd3a68b authored by Ryan Bloom's avatar Ryan Bloom
Browse files

Stop using the request filters to filter an error response. This fixes a

bug where we were using the byterange filter to filter an error, which
caused us to close the connection before we had sent any data.  Currently,
we only keep the three most important filters, but we may need to add more
in the future.  I am mostly thinking of the charset translation filter.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@87854 13f79535-47bb-0310-9956-ffa450edef68
parent 60131d5f
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
Changes with Apache 2.0b1

  *) If we get an error, then we should remove all filters except for
     those critical to serving a web page.  This fixes a bug, where
     error pages were going through the byterange filter, even though
     that made no sense.  [Ryan Bloom]

  *) Relax the syntax checking of Host: headers in order to support
     iDNS. PR#6635 [Tony Finch]

+1 −5
Original line number Diff line number Diff line
APACHE 2.0 STATUS:						-*-text-*-
Last modified at [$Date: 2001/01/26 02:27:03 $]
Last modified at [$Date: 2001/01/26 17:54:03 $]

Release:

@@ -30,10 +30,6 @@ RELEASE SHOWSTOPPERS:
        Status: patch brought forward from 1.3.14
                WIN32 and OS2 need review [William Rowe, Brian Harvard]

    * Error messages are filtered according to the needs of the original 
      URI.  Nothing ensures that they are translated on EBCDIC machines
      and *not* translated on ASCII machines.

    * Win32: Enable the Windows MPM to honor max_requests_per_child
        Status: FirstBill will fix this?

+20 −1
Original line number Diff line number Diff line
@@ -3420,6 +3420,24 @@ static const char *get_canned_error_string(int status,
	}
}

static void reset_filters(request_rec *r)
{
    ap_filter_t *f = r->output_filters;

    while (f) {
        if (!strcasecmp(f->frec->name, "CORE") ||
            !strcasecmp(f->frec->name, "CONTENT_LENGTH") ||
            !strcasecmp(f->frec->name, "HTTP_HEADER")) {
            f = f->next;
            continue;
        }
        else {
            f = f->next;
            ap_remove_output_filter(f);
        }
    }
}

/* 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),
@@ -3437,6 +3455,7 @@ AP_DECLARE(void) ap_send_error_response(request_rec *r, int recursive_error)
     * this value.
     */
    r->eos_sent = 0;
    reset_filters(r);

    /*
     * It's possible that the Location field might be in r->err_headers_out