tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 54628] New: there is something wrong when send binary data by websocket.
Date Sat, 02 Mar 2013 08:37:25 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=54628

            Bug ID: 54628
           Summary: there is something wrong when send binary data by
                    websocket.
           Product: Tomcat 7
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: b.lee@foxmail.com
    Classification: Unclassified

there is something wrong when send binary data by websocket.

see org.apache.catalina.websocket.WsOutbound.doWriteBytes(ByteBuffer, boolean)

I think 

// Write the content
        upgradeOutbound.write(buffer.array(), 0, buffer.limit());
        upgradeOutbound.flush();

should change to :

// Write the content
        upgradeOutbound.write(buffer.array(), buffer.arrayOffset(),
buffer.limit());
        upgradeOutbound.flush();


For example:
byte[] bts = new byte[]{1,2,3,4,5}
ByteBuffer bf = ByteBuffer.wrap(bts, 2, 2);
out.writeBinaryMessage(bf);

I mean write [3,4] to the client, but in fact [1,2,3,4] be sent;

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