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 2016/12/13 12:16:38 UTC

[Bug 59664] BufferReader return fuzzied when use https transfer Unicode char

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

liujian <el...@huawei.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|INVALID                     |REMIND

--- Comment #3 from liujian <el...@huawei.com> ---
Hi:

sorry about the issuss

i see the code of the org.apache.catalina.connector.InputBuffer
    public int available() {
        int available = 0;
        if (state == BYTE_STATE) {
            available = bb.getLength();
        } else if (state == CHAR_STATE) {
            available = cb.getLength();
        }
        if (available == 0) {
            coyoteRequest.action(ActionCode.AVAILABLE, null);
            available = (coyoteRequest.getAvailable() > 0) ? 1 : 0;
        }
        return available;
    }

    public boolean ready()
        throws IOException {

        if (closed) {
            throw new IOException(sm.getString("inputBuffer.streamClosed"));
        }

        return (available() > 0);
    }


you see,if only one byte in 'bb',the 'ready()' will return 'true'
But for 'Unicode',only one byte can not read success

So, we can not use 'ready()' to get 'Reader' is available or not

i think 'ready()' of 'Reader' should imporve

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