You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by RCHAPACH Rochester <rc...@us.ibm.com> on 2002/09/11 17:16:08 UTC

[PATCH] Added Output filters and internal_fast_redirect on 2.0.39

I posted quite a while back about a problem we found with using
DirectoryIndex in conjunction with content negotiation, where the Apache
server was not sending any response - it just wrote 0 bytes to the socket.

I've since dug into this problem some more, and it turns out that the
problem is due to additional output filters that we have inserted. Since we
are running on an EBCDIC machine (the iSeries - aka the AS/400), we are
inserting a translation output filter.  This filter is inserted as an
AP_FTYPE_RESOURCE filter, which is inserted on the stack above the subreq
output filter. The filter is not removed, and this causes the EOS bucket to
be tossed, and that in turn prevents the
other filters from sending data.

Since other platforms may also be adding output filters of this type, here
is the patch I worked up, submitted for your approval.

--- http_request.c             Mon Aug 12 14:28:22 2002
+++ http_request_fix.c         Mon Aug 12 14:39:10 2002
@@ -442,7 +442,23 @@
         ap_remove_output_filter(r->output_filters);
         r->output_filters = r->output_filters->next;
     }
+    /* There may be a filter of type
AP_FTYPE_RESOURCE (10) present, so the subreq filter
is NOT
+     * first. We'll try to look through the filters
for the subreq_core filter, and remove
+     * that.
+     */
+    else {
+            filters = r->output_filters; /* Make a copy to walk
through the list with */
+            while ( filters && filters->frec !=
ap_subreq_core_filter_handle ) {
+                filters = filters->next;
+            }
+
+            if (filters->frec ==  ap_subreq_core_filter_handle)
{
+                ap_remove_output_filter(filters);
+                filters = filters->next;
+            }

+    }
+
     /* If any filters pointed at the now-defunct rr,
we must point them
      * at our "new" instance of r.  In particular,
some of rr's structures
      * will now be bogus (say rr->headers_out).  If a
filter tried to modify


Thanks,

Marion Pitts

rchapach@us.ibm.com