-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RangeError with Raw encoding at websock.js #557
Comments
@daniq can you add some debug to _decode_message to show how large data, u8 and _rQlen are before this error. You might be running into a limitation with typed arrays in your browser. Speaking of which, what browser and version are you running into this with? Also, have you tried with a different browser to see if the error is still present? Unfortunately, due to the design of the RFB protocol, it's not possible to recover from errors processing the data stream. Well designed protocols have a length at the beginning of every data frame, but in RFB you must correctly process all the data in the stream, or you basically will get lost and not be able to sync up the stream again. |
It's also possible that there are large messages involved that are overwhelming the receive queue before it gets a chance to resize. For various reasons, noVNC's receive queue is statically allocated. It starts out at 4 MiB, and doubles in size if it ever grows beyond half its capacity. Since the adjustment occurs after the message is received, it's possible that you've sent a message that is larger than what the buffer can handle (this would be necessarily have to be greater than 2 MiB in size, and probably larger, depending on the conditions). I can tweak the code to also make any necessary adjustments to the buffer ahead of time, but it would be nice to also confirm that there isn't some other underlying issue here that also needs to be fixed in noVNC. Could you confirm if you're sending large messages like that? |
Thank you for quick and comprehensive replies.
Tried Safari with the following error:
What helps me is to revert recently updated noVNC library to one of the previous versions where 'decode_message' looks like:
This version takes a punch. |
That version doesn't have a fixed-size array, and is much slower in certain aspects. I'll update the code to handle such cases better. |
Nice, thanks! Possibly it should be some array size constant to be available to change. |
This commit causes the receive queue to dynamically resize to fit incoming messages. Fixes #557
Hey, sorry for the delay (I've been busy at work lately). Can you take a look at #565? It should fix your issue. |
This commit causes the receive queue to dynamically resize to fit incoming messages. Fixes #557
Yep, I'll test it, thank you. But I can't promise you it will be soon. |
I have a custom app that communicates via RFB protocol. It use noVNC to display UI. Using Hextile encoding is ok, switching to Raw periodically produce the following exceptions:
I'm not seeing errors in Raw encoding at my app side, but they can be there) However I think anyway noVNC should deal with this gracefully.
Could someone give me a clue why it happens?
The text was updated successfully, but these errors were encountered: