]> granicus.if.org Git - apache/commitdiff
Prevent ap_add_output_filters_by_type from being called in
authorJustin Erenkrantz <jerenkrantz@apache.org>
Mon, 1 Apr 2002 22:26:09 +0000 (22:26 +0000)
committerJustin Erenkrantz <jerenkrantz@apache.org>
Mon, 1 Apr 2002 22:26:09 +0000 (22:26 +0000)
ap_set_content_type if the content-type hasn't changed.

Reviewed by: Ryan Bloom

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94368 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/http/http_protocol.c

diff --git a/CHANGES b/CHANGES
index fe905a26c720ee2698209484c36e44c58c4cb6f2..02667e3efb16ff10ccb4987a23a57f8f561d4f5a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,9 @@
 Changes with Apache 2.0.35
 
+  *) Prevent ap_add_output_filters_by_type from being called in
+     ap_set_content_type if the content-type hasn't changed.
+     [Justin Erenkrantz]
+
   *) Performance: implemented the bucket allocator made possible by the
      API change in 2.0.34.  [Cliff Woolley]
 
index c6a54b653d186502a4e35808cc9c8b10474d87e9..8e5029884b69823eccabeae5bd6821314a78d459 100644 (file)
@@ -1272,14 +1272,16 @@ static void fixup_vary(request_rec *r)
 
 AP_DECLARE(void) ap_set_content_type(request_rec *r, const char *ct)
 {
-    r->content_type = ct;
+    if (!r->content_type || strcmp(r->content_type, ct)) {
+        r->content_type = ct;
 
-    /* Insert filters requested by the AddOutputFiltersByType 
-     * configuration directive. Content-type filters must be 
-     * inserted after the content handlers have run because 
-     * only then, do we reliably know the content-type.
-     */
-    ap_add_output_filters_by_type(r);
+        /* Insert filters requested by the AddOutputFiltersByType 
+         * configuration directive. Content-type filters must be 
+         * inserted after the content handlers have run because 
+         * only then, do we reliably know the content-type.
+         */
+        ap_add_output_filters_by_type(r);
+    }
 }
 
 typedef struct header_filter_ctx {