Summary: | mod_jk incorrectly creates duplicate content-length:0 header | ||
---|---|---|---|
Product: | Tomcat Connectors | Reporter: | Boris Maras <bmaras> |
Component: | Common | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | CLOSED FIXED | ||
Severity: | normal | CC: | step.pubinfo |
Priority: | P2 | Keywords: | RFC |
Version: | unspecified | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Linux | ||
Attachments: |
Packet captures of the duplicate content-length:0
Proposed patch in mod_jk.c |
Description
Boris Maras
2007-02-14 05:48:20 UTC
We tried an upgrade to Apache 2.0.59 (with mod_jk-apache-2.0.58.so) and Apache 2.2.4 (with mod_jk-apache-2.2.3.so) : not better. Created attachment 19590 [details]
Packet captures of the duplicate content-length:0
These are 4 packet captures that follow a single packet through the servers :
client -> Apache D -> Tomcat C -> Apache B -> Tomcat A
We can see in these captures that :
- the client sends only one content-lenth:0 header
- Apache D sends duplicate headers
- Tomcat C re-sends the same duplicate headers
- Apache B rejects the request and does not send anything to Tomcat A
Created attachment 19591 [details]
Proposed patch in mod_jk.c
Our problem has been solved with the following patch in mod_jk.c
The code seems to look for an existing content-length header before adding the
content-length:0 header.
So it loops through the headers and compares them to the string
"content-length". But the comparison was made on the header values. We changed
it to make the comparison on the header names.
Thanks for the analysis. I committed you patch. It will be part of 1.2.21. YEPLA! Our first committed bugfix in such a great project ! Thanks Rainer for such a quick answer and thanks for all the work done by the apache team. The patch has been backported for our use in version 1.2.19 and also works without any problem. We didn't study porting this patch to 2.2.x version but it seems to have a similar behaviour. PS for boris :D APERO !! I applied the fix to the Apache 1.3 and 2 code lines of mod_jk. The Apache 2 code line fixes it for 2.0 and 2.2. Move a couple of fixed JK issues from resolved to closed. |