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 2013/03/02 09:37:25 UTC

[Bug 54628] New: there is something wrong when send binary data by websocket.

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


[Bug 54628] there is something wrong when send binary data by websocket.

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54628

blee <b....@foxmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|unspecified                 |7.0.37
           Severity|normal                      |major

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


[Bug 54628] there is something wrong when send binary data by websocket.

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54628

blee <b....@foxmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |b.lee@foxmail.com

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


[Bug 54628] there is something wrong when send binary data by websocket.

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=54628

Mark Thomas <ma...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #1 from Mark Thomas <ma...@apache.org> ---
Thanks for the report and for the fix.

This has been fixed in trunk and 7.0.x and will be included in 7.0.38 onwards.

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