https://issues.apache.org/bugzilla/show_bug.cgi?id=57485

            Bug ID: 57485
           Summary: mod_jk passed the incomplete chunked transferred
                    request body to tomcat
           Product: Tomcat Connectors
           Version: 1.2.40
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mod_jk
          Assignee: dev@tomcat.apache.org
          Reporter: charleschung...@gmail.com

Created attachment 32392
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=32392&action=edit
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

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to