codebutler / android-websockets

Bare minimum websockets (hybi13/RFC) client for Android
713 stars 494 forks source link

"Expected non-final packet" on fragmented messages #3

Open jketterl opened 12 years ago

jketterl commented 12 years ago

I'm having a little trouble receiving big messages from a node.js websocket server (if it's of any use, the server side uses this library). The connection seems to close with the "Expected non-final packet" exception every time a text message that can't be contained in a single frame is received.

I've took some time and read the code and the ietf rfc (this version here) and from what i see, it seems your code is choking on the initial frame that is supposed to start the fragmented message because it believes the message to be a continuation frame.

I've changed the list of opcodes allowed for fragmentation (FRAGMENTED_OPCODES) to only contain OP_CONTINUATION and it seems to work now. i am however unsure wether this is the correct fix for the situation at hand, so i'd like to hear your opinions on that.

max-mapper commented 12 years ago

+1