codebutler / android-websockets

Bare minimum websockets (hybi13/RFC) client for Android
712 stars 495 forks source link

wrong close frame status code parsing #9

Open osanha opened 11 years ago

osanha commented 11 years ago

https://github.com/codebutler/android-websockets/blob/master/src/com/codebutler/android_websockets/HybiParser.java#L290

must be patched like below.

int code = (payload.length >= 2) ? ((payload[0] << 8) | (payload[1] & 0xFF)) & 0xFFFF : 0;

because, close status code is unsigned short value (0 ~ 65535). but java byte type is singed value (-128 ~ 127)

do test with status code 4504 or 65535.