Created attachment 32392 [details] packet capture I'm using mod_jk to connect apache to tomcat, When I send the following tcp packets(to simulate incomplete chunked body) and close the socket,strangely my servlet did received the partial body as complete,packet capture shows that mod_jk decoded the chunked body and passed the incomplete body just as complete to tomcat. Please see the packet capture file for details. 1.tcp packet I sent <pre> POST /TestServlet/helloworld HTTP/1.1 Host: 192.168.1.58 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.5) Gecko/20091102 Firefox/3.5.5 (.NET CLR 3.5.30729) Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Pragma: no-cache Cache-Control: no-cache Content-Type: application/x-www-form-urlencoded; charset=UTF-8 Transfer-Encoding: chunked 5 k=12<EOF> </pre> 2.servlet code <pre> @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { System.out.println("doPost start"); Enumeration pem = req.getParameterNames(); while (pem.hasMoreElements()) { String k = pem.nextElement().toString(); String v = req.getParameter(k); System.out.println(k + "=" + v); } System.out.println("doPost end"); } </pre> 3.the current result the servlet outputs the following <pre> doPost start k=12 doPost end </pre> 4.the result I expected <pre> doPost start doPost end </pre> Please
mod_jk is using apache httpd api to read (and de-chunk) the http body,so the cause may be in apache ,instead of mod_jk. I am using Apache/2.2.15,after searching bug relating to chunked-transfering,I found https://issues.apache.org/bugzilla/show_bug.cgi?id=55475 which seems to relate to this one. I will try upgrading apache to 2.2.18(at which version the issue 55475 is fixed) or higher to see the result
Even after upgrading to the latest version of apache(2.4.10) + APR 1.5.1,noghting changes:the incomplete chunked-transfered body is still sent to tomcat(servlet).
Thanks for the report. This has been fixed in trunk for 1.2.42 onwards.
Hello Mark, What's the expected release date for mod_jk 1.2.42 ? Thanks