You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Jeff Trawick <tr...@bellsouth.net> on 2000/10/24 20:09:00 UTC

CHUNK and HTTP_HEADER out of order

Because CHUNK is inserted by HTTP_HEADER, CHUNK has to end up *after*
HTTP_HEADER in the filter list.  Otherwise, the first brigade of the
response body can't be chunked.  Currently, CHUNK ends up *before*
HTTP_HEADER in the filter list, breaking chunked responses.

Ryan is working on the filter type cleanup, but I'll kludge something
up in the meantime so that CHUNK gets added after HTTP_HEADER.

-- 
Jeff Trawick | trawick@ibm.net | PGP public key at web site:
     http://www.geocities.com/SiliconValley/Park/9289/
          Born in Roswell... married an alien...

Re: CHUNK and HTTP_HEADER out of order

Posted by Jeff Trawick <tr...@bellsouth.net>.
rbb@covalent.net writes:

> I'm actually in the middle of hacking mod_include to make it work for the
> time being.  Feel free to do the filter type cleanup.  If you don't get to
> it, I'll do it tomorrow sometime.

This gets chunking of output working again.  I'm not sure how close it
is to the desired state.  I'll wait a bit to commit in case there are
any comments.

I think I've tested all of it successfully except for the subrequest
filter.  The logic in mod_include.c:include_cgi() to pass the output
of the subrequest through *remaining* main-request filters (rather
than all of them) cuts off the subrequest filter since the subrequest
filter was added before that logic.  We need to work out a solution to
that issue (i.e., how to properly send the output of a subrequest
through remaining main-request filters).

Index: src/include/util_filter.h
===================================================================
RCS file: /home/cvspublic/apache-2.0/src/include/util_filter.h,v
retrieving revision 1.29
diff -u -r1.29 util_filter.h
--- src/include/util_filter.h	2000/10/21 17:22:26	1.29
+++ src/include/util_filter.h	2000/10/24 19:26:55
@@ -182,8 +182,11 @@
  * the ordering is equivalent to the order of calls to ap_add_*_filter().
  */
 typedef enum {
-    AP_FTYPE_CONTENT,
-    AP_FTYPE_CONNECTION
+    AP_FTYPE_CONTENT     = 10,
+    AP_FTYPE_HTTP_HEADER = 20,
+    AP_FTYPE_TRANSCODE   = 30,
+    AP_FTYPE_CONNECTION  = 40,
+    AP_FTYPE_NETWORK     = 50
 } ap_filter_type;
 
 /*
Index: src/main/http_core.c
===================================================================
RCS file: /home/cvspublic/apache-2.0/src/main/http_core.c,v
retrieving revision 1.183
diff -u -r1.183 http_core.c
--- src/main/http_core.c	2000/10/22 15:26:05	1.183
+++ src/main/http_core.c	2000/10/24 19:27:57
@@ -3577,13 +3577,13 @@
      */
     ap_hook_insert_filter(core_insert_filter, NULL, NULL, AP_HOOK_MIDDLE);
     ap_register_input_filter("HTTP_IN", ap_http_filter, AP_FTYPE_CONNECTION);
-    ap_register_input_filter("DECHUNK", ap_dechunk_filter, AP_FTYPE_CONNECTION + 1);
-    ap_register_input_filter("CORE_IN", core_input_filter, AP_FTYPE_CONNECTION);
-    ap_register_output_filter("HTTP_HEADER", ap_http_header_filter, AP_FTYPE_CONTENT - 1);
-    ap_register_output_filter("CORE", core_output_filter, AP_FTYPE_CONNECTION + 1);
+    ap_register_input_filter("DECHUNK", ap_dechunk_filter, AP_FTYPE_TRANSCODE);
+    ap_register_input_filter("CORE_IN", core_input_filter, AP_FTYPE_NETWORK);
+    ap_register_output_filter("HTTP_HEADER", ap_http_header_filter, AP_FTYPE_HTTP_HEADER);
+    ap_register_output_filter("CORE", core_output_filter, AP_FTYPE_NETWORK);
     ap_register_output_filter("SUBREQ_CORE", ap_sub_req_output_filter, 
                               AP_FTYPE_CONTENT);
-    ap_register_output_filter("CHUNK", chunk_filter, AP_FTYPE_CONNECTION);
+    ap_register_output_filter("CHUNK", chunk_filter, AP_FTYPE_TRANSCODE);
     ap_register_output_filter("COALESCE", coalesce_filter, AP_FTYPE_CONNECTION);
 }
 

-- 
Jeff Trawick | trawick@ibm.net | PGP public key at web site:
     http://www.geocities.com/SiliconValley/Park/9289/
          Born in Roswell... married an alien...

Re: CHUNK and HTTP_HEADER out of order

Posted by rb...@covalent.net.
On Tue, 24 Oct 2000, Jeff Trawick wrote:

> Because CHUNK is inserted by HTTP_HEADER, CHUNK has to end up *after*
> HTTP_HEADER in the filter list.  Otherwise, the first brigade of the
> response body can't be chunked.  Currently, CHUNK ends up *before*
> HTTP_HEADER in the filter list, breaking chunked responses.
> 
> Ryan is working on the filter type cleanup, but I'll kludge something
> up in the meantime so that CHUNK gets added after HTTP_HEADER.

I'm actually in the middle of hacking mod_include to make it work for the
time being.  Feel free to do the filter type cleanup.  If you don't get to
it, I'll do it tomorrow sometime.

Ryan

_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------