You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2015/01/23 06:15:43 UTC

[Bug 57485] New: mod_jk passed the incomplete chunked transferred request body to tomcat

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.cn@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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


[Bug 57485] mod_jk passed the incomplete chunked transferred request body to tomcat

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57485

--- Comment #2 from charleschung.cn@gmail.com ---
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).

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

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


[Bug 57485] mod_jk passed the incomplete chunked transferred request body to tomcat

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57485

--- Comment #1 from charleschung.cn@gmail.com ---
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

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

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


[Bug 57485] mod_jk passed the incomplete chunked transferred request body to tomcat

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57485

charleschung.cn@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|                            |57492

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

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


[Bug 57485] mod_jk passed the incomplete chunked transferred request body to tomcat

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57485

charleschung.cn@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |charleschung.cn@gmail.com

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

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