Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 341427 - Can't send data whose size "mod 256" result is between 128 bytes and 255 bytes to WebSocket server.
Summary: Can't send data whose size "mod 256" result is between 128 bytes and 255 byte...
Status: CLOSED INVALID
Alias: None
Product: Jetty
Classification: RT
Component: server (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 critical (vote)
Target Milestone: 7.2.x   Edit
Assignee: Greg Wilkins CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-30 16:59 EDT by zhuhao03 CLA
Modified: 2011-03-30 17:50 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description zhuhao03 CLA 2011-03-30 16:59:58 EDT
Build Identifier: 20100917-0705

WebSocketParserD06 and WebSocketParserD01 are both having bugs in parsing LENGTH_16 & LENGTH_63. There is a line "_length = _length<<8 | b", in which b should be an unsigned byte representing size. However, here b is treated as signed byte, and the _length can be NEGATIVE as a result.

The correct code should be "_length = _length<<8 | (b & 0xff)".

Reproducible: Always

Steps to Reproduce:
1. Run any simple websocket echo program. Remember to log the received message size in server side.
2. Send message with 128 bytes.
3. See the log message in server side. The message size is negative.
Comment 1 zhuhao03 CLA 2011-03-30 17:50:52 EDT
Ok. It seems my code has some problem. Close the bug.