https://bz.apache.org/bugzilla/show_bug.cgi?id=65137

            Bug ID: 65137
           Summary: Invalid chunk encoding in the tomcat answer
           Product: Tomcat 8
           Version: 8.5.x-trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Connectors
          Assignee: dev@tomcat.apache.org
          Reporter: barm...@adobe.com
  Target Milestone: ----

Hi,

When tomcat is sending a huge answer (which is thus chunk encoded), the answer
may become invalid at some point if the client reads this answer slowly.

STR:
- create a small jsp that output a lot of data:
<html><body><%
StringBuilder s = new StringBuilder();
for( int i = 0; i < 6300000; i++ )
//for( int i = 0; i < 630; i++ )
{
  s.append("<p>line ");
  s.append(i);
  s.append("<p>\n");
}
out.println(s.toString());
%></body></html>
- start tomcat (default config)
- get the answer with a limited bandwith (no issue otherwise): curl
--limit-rate 70k http://localhost:8080/test.jsp -o /dev/null
- after some time (around 2-3min), an error is raised by curl:
curl: (56) Malformed encoding found in chunked-encoding

Regarding the network capture for this issue, it seems that tomcat restart the
sending of a chunk while the same chunk was being sent (and was nearly
finished). The next chunk seems to be sent correctly (but the answer is no
longer valid at this point).

I can reproduce on Tomcat 9 too (but not on tomcat 7). I can reproduce on
debian 10 (with the default openjdk 11) and debian 9 (with the default openjdk
8).

Regards.

-- 
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