]> granicus.if.org Git - apache/commitdiff
Stop using the request filters to filter an error response. This fixes a
authorRyan Bloom <rbb@apache.org>
Fri, 26 Jan 2001 17:54:06 +0000 (17:54 +0000)
committerRyan Bloom <rbb@apache.org>
Fri, 26 Jan 2001 17:54:06 +0000 (17:54 +0000)
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

CHANGES
STATUS
modules/http/http_protocol.c

diff --git a/CHANGES b/CHANGES
index dcfb1a59b0459d40dd11c5d33f330cc76879d676..8c783c18fbf1749e526f73819767ec01bd93399d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,10 @@
 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]
 
diff --git a/STATUS b/STATUS
index a575ea30d6d61ea13678930c7b25925dd121980d..69ae497eeffa15808eb7fdd99e82542a4bc8cffa 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -1,5 +1,5 @@
 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?
 
index 434a28cdbfcd2bdab4777b325a9dbc46ba524589..4a46395d2bc5b16d788f0bbe320cdc4c8b804ed7 100644 (file)
@@ -3419,7 +3419,25 @@ 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