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

--- Comment #6 from Sudhan Moghe <sudhan.mo...@gmail.com> ---
Tested with protocol="HTTP/1.1" and <async-supported>false</async-supported>

Took latest code from trunk and then added following debug statements to
ChunkedInputFilter.

if (pos >= lastValid) {
            int readBytes = readBytes();
            if (readBytes <= 0){
                System.out.println("ChunkedInputFilter.doRead()1 readBytes
returned : " + readBytes);
            }
        }

        if (remaining > (lastValid - pos)) {
            result = lastValid - pos;
            System.out.println("ChunkedInputFilter.doRead()2 result: " + result
+ " remaining: " + remaining + " lastValid: " + lastValid + " pos: " + pos);

Output on console
ChunkedInputFilter.doRead()1 readBytes returned : -1
ChunkedInputFilter.doRead()2 result: -1 remaining: 8192 lastValid: 334 pos: 335

Method returns -1, which is treated as normal EOF. And application ends up
processing incomplete data.

"return -1" won't do as that is what is being returned.

"throw new EOFException("Unexpected end of stream while reading chunk body");"
or
"throw new org.apache.catalina.connector.ClientAbortException()"
looks appropriate.

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