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]
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 {