Bug 55853

Summary: mod_jk doesn't set the content length correctly for apache 2.x
Product: Tomcat Connectors Reporter: areese <areese>
Component: mod_jkAssignee: Tomcat Developers Mailing List <dev>
Severity: normal    
Priority: P2    
Version: 1.2.37   
Target Milestone: ---   
Hardware: PC   
OS: Linux   

Description areese 2013-12-06 18:27:08 UTC
We ran into a bug with apache 2.2.24, where content-length wasn't be set correctly because it's set as a header instead of using the struct.

394     else if (!strcasecmp(header_names[h], "Content-Length")) {
395         apr_table_set(r->headers_out, header_names[h], header_values[h]);
396     }
397     else if (!strcasecmp(header_names[h], "Transfer-Encoding")) {

This is a bug and needs to be something like:

else if (!strcasecmp(header_names[h], "Content-Length")) {
    ap_set_content_length(r, apr_atoi64(header_values[h]));

The problem is that mod_jk is setting the headers out, but not setting the
r->clength value.  Calling ap_set_content_length sets both.
Comment 1 Rainer Jung 2013-12-08 20:12:46 UTC
Thanks for the patch. Extended for the httpd 1.3 branch and committed to mod_jk in r1549202. Will be part of version 1.2.38.