tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 54456] ChunkedInputFilter returning EOF when client closes connection without sending end chunk
Date Wed, 06 Feb 2013 20:10:18 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=54456

--- Comment #6 from Sudhan Moghe <sudhan.moghe@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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message