mod_proxy does not send a Content-Length header, seems because of the 
flush bucket inserted by ap_proxy_http_process_response()

if i break in ap_content_length_filter, when a request is handled by 
default_handler, brigade looks like so:
(gdb) dump_brigade b
dump of brigade 0x8235318
   0: bucket=FILE(0x8238c28), length=26, data=0x8238c78
   1: bucket=EOS(0x822e998), length=0, data=0x0

here's what it currently looks like when handled by the proxy:
(gdb) dump_brigade b
dump of brigade 0x82310a8
   0: bucket=HEAP(0x822e998), length=26, data=0x8238c28
   1: bucket=FLUSH(0x8218ea8), length=0, data=0x0
(gdb) dump_brigade b
dump of brigade 0x82310a8
   0: bucket=EOS(0x8238c28), length=0, data=0x0

if i remove the flush bucket (patch below), then proxy requests do get a 
Content-Length header.  doesn't seem like proxy should be flushing to 
begin with.  thoughts?

Index: modules/proxy/proxy_http.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/proxy/proxy_http.c,v
retrieving revision 1.143
diff -u -r1.143 proxy_http.c
--- modules/proxy/proxy_http.c  2 Apr 2002 04:30:49 -0000       1.143
+++ modules/proxy/proxy_http.c  5 Apr 2002 04:17:09 -0000
@@ -841,7 +841,6 @@
             if ( (conf->error_override ==0) || r->status < 400 ) {
 
                 /* read the body, pass it to the output filters */
-                apr_bucket *e;
                 int finish = FALSE;
                 while (ap_get_brigade(rp->input_filters, 
                                       bb, 
@@ -873,12 +872,6 @@
                         ap_proxy_http_cleanup(r, p_conn, backend);
                         /* signal that we must leave */
                         finish = TRUE;
-                    }
-
-                    /* if no EOS yet, then we must flush */
-                    if (FALSE == finish) {
-                        e = apr_bucket_flush_create(c->bucket_alloc);
-                        APR_BRIGADE_INSERT_TAIL(bb, e);
                     }
 
                     /* try send what we read */

Reply via email to