Content-Length header should be set using ap_set_content_length

Artur Zaprzała <[email protected]>
Newsgroups gmane.comp.web.fastcgi.devel
Message-ID <[email protected]>
Content-Length header should be set using ap_set_content_length() function in 
process_headers(). I fixed this about 3 years ago and I don't remember what was 
the problem with the current aproach, but it surely was.

Today I did some research to support my fix.

Currently process_headers() adds Content-Length to err_headers_out. Here is 
description of err_headers_out from Apache documentation:
> The difference between headers_out and err_headers_out is that the latter are printed even on error, and persist across internal redirects (so the headers printed for ErrorDocument handlers will have them).

And Content-Length shouldn't persist across internal redirects.

_______________________________________________
FastCGI-developers mailing list
FastCGI-developers-xGejAJT2w6xVgU18Zptdi0EOCMrvLtNR@public.gmane.org
http://mailman.pins.net/mailman/listinfo.cgi/fastcgi-developers
mod_fastcgi-clength.patch (text/x-patch, 539 B)
--- mod_fastcgi.c-orig	2008-09-23 16:56:45.000000000 +0200
+++ mod_fastcgi.c	2008-11-03 20:49:30.000000000 +0100
@@ -741,6 +741,10 @@
                 ap_table_set(r->headers_out, "Location", value);
                 continue;
             }
+            if (strcasecmp(name, "Content-Length") == 0) {
+                ap_set_content_length(r, strtol(value, NULL, 10));
+                continue;
+            }
 
             /* If the script wants them merged, it can do it */
             ap_table_add(r->err_headers_out, name, value);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.