Bug 55853 - mod_jk doesn't set the content length correctly for apache 2.x
Summary: mod_jk doesn't set the content length correctly for apache 2.x
Status: RESOLVED FIXED
Alias: None
Product: Tomcat Connectors
Classification: Unclassified
Component: mod_jk (show other bugs)
Version: 1.2.37
Hardware: PC Linux
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-06 18:27 UTC by areese
Modified: 2013-12-08 20:12 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.