Bug 39528 - ajp_parse_data: Wrong chunk length
Summary: ajp_parse_data: Wrong chunk length
Status: RESOLVED INVALID
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mod_proxy (show other bugs)
Version: 2.2.2
Hardware: All Linux
: P2 major (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-09 08:20 UTC by Edward Fjellsk
Modified: 2008-08-04 01:52 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Edward Fjellsk 2006-05-09 08:20:50 UTC
the check in modules/proxy/ajp_header.c line 712:
expected_len = msg->len - (AJP_HEADER_LEN + AJP_HEADER_SZ_LEN + 1 + 1);
Is giving me "off by one errors":
[Tue May 09 09:59:58 2006] [error] ajp_parse_data: Wrong chunk length. Length of
chunk is 8186, expected length is 8185.
[Tue May 09 09:59:58 2006] [error] (120007)APR does not understand this error
code: proxy: send body failed to (null) (server)
[Tue May 09 09:59:59 2006] [error] ajp_parse_data: Wrong chunk length. Length of
chunk is 135, expected length is 134.
[Tue May 09 09:59:59 2006] [error] (120007)APR does not understand this error
code: proxy: send body failed to (null) (server)

Changing the line to:
expected_len = msg->len - (AJP_HEADER_LEN + AJP_HEADER_SZ_LEN + 1 );
Makes it work right.
Comment 1 Ruediger Pluem 2006-05-09 14:10:26 UTC
What kind of ajp server are you using? If Tomcat please let me know the version
you are using.
Comment 2 Edward Fjellsk 2006-05-09 14:19:33 UTC
Server: Oracle Application Server Containers for J2EE 10g (9.0.4.0.0)
Comment 3 Ruediger Pluem 2006-05-10 05:30:36 UTC
So the Oracle Application Server does not sent the correct chunk length as
mod_proxy_ajp works fine with Tomcat. As stated in the comment above the code
the terminating zero of the message does not belong to the chunk itself and is
not contained in the chunk length (but in the message length). This works this
way since Tomcat 4.0.x. Changing the line to what you have proposed would make
mod_proxy_ajp stop working with Tomcat.
Comment 4 Edward Fjellsk 2006-05-10 12:39:19 UTC
ok!
More testing shows that running mod_proxy_ajp (with my fix) makes my oc4j
servers crash :) 
Comment 5 Andreas Joseph Krogh 2008-08-04 01:52:58 UTC
I'm having the same problem with OC4J-10.1.3.3 using mod_proxy_ajp in Apache-2.2.9. Anyone knows a fix for this?