Skip to content
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

WebSocketPeer breaking on inbound buffer overflow #84423

Closed
Nitwel opened this issue Nov 3, 2023 · 1 comment · Fixed by #97913
Closed

WebSocketPeer breaking on inbound buffer overflow #84423

Nitwel opened this issue Nov 3, 2023 · 1 comment · Fixed by #97913

Comments

@Nitwel
Copy link

Nitwel commented Nov 3, 2023

Godot version

4.1.3-stable

System information

Godot v4.1.3.stable - Windows 10.0.19045 - Vulkan (Mobile) - dedicated NVIDIA GeForce RTX 3080 (NVIDIA; 31.0.15.3667) - Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz (16 Threads)

Issue description

When we connect to a WebSocket server that sends more than 65535 bytes to Godot, the WebSocketPeer seems to break without any error, doesn't receive further messages and doesn't disconnect if the server shuts down.

This is somewhat related to #70738 but I still would count this as a different bug.

Steps to reproduce

Create a minimal WebSocketServer that sends more than 65535 bytes to the client after connecting.

The example files include:

  • A JS WebSocket Server (requires ws to be installed over npm)
  • An example Godot project that will break when trying to connect to the JS WebSocket Server

I'm doing the following:

  1. Send a small package of 32780 bytes which will be received
  2. Send a large package of 131072 bytes which will crash the WSPeer
  3. Send a small package of 32780 bytes to show that no more messages can be received
  4. Now, close the server and see that the client never goes into STATE_CLOSING or STATE_CLOSED

Minimal reproduction project

Example Files

@kle-sd
Copy link

kle-sd commented Apr 18, 2024

For anyone running into this issue, this can be resolved by setting WebSocketPeer.inbound_buffer_size (and for outbound, outbound_buffer_size).

Though, I do believe the instance should provide an elegant failure incase of buffer overflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants