You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WebsocketPeer, when running through the WSLPeer implementation (anything non HTML5), has an unbound output message buffer.
This manifests itself under conditions where outbound traffic on the put_packet() interface under WebSocketPeer exceeds what the far-end can pull out.
The output buffer configuration in WSLPeer::make_context() is unused (and actually the p_out_pkt_size parameter is incorrectly being used to configure the receiving _packet_buffer size) . This causes the underlying wslay wslay_event_queue_msg() to indefinitely queue up messages into the internal wslay message queue. This queue is unbound.
Steps to reproduce
Send traffic through WSLPeer::put_packet() and observe the internal wslay queue length in wslay_queue_push().
Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered:
jordo
changed the title
WSLPeer::put_packet has an unbound outgoing buffer
WSLPeer::put_packet has an unbound outgoing buffer. Websocket outgoing bufferes unused.
Jul 28, 2021
jordo
changed the title
WSLPeer::put_packet has an unbound outgoing buffer. Websocket outgoing bufferes unused.
WSLPeer::put_packet has an unbound outgoing buffer. Websocket outgoing buffers unused.
Jul 28, 2021
@Fales the likely fix here is to query wslay_event_get_queued_msg_count() and wslay_event_get_queued_msg_length() prior to sending a packet to wslay_event_queue_msg().
But I want to propose exposing these two buffer queue query sizes as well, and I'll explain my reasoning below.
WebsocketPeer is effectively a packet peer (implements a packet peer api) in Godot, but is backed by a stream (tcp). So it's important to be able to query the current outbound buffer capacity before stuffing it. We end up using the WebsocketPeer for a variety of use cases in our application, but I would love to inspect the current size of the outbound buffer, because our application could make better decisions about utilization with the ability to inspect the current outbound buffer.
The WebsocketPeer buffers in godot, are application level and configurable, so it would be great to expose the ability to inspect the current status of each buffer. It allows more flexibility for the application to decide what to do when approaching buffer limits.
Godot version
3.X, 4.X
System information
All
Issue description
WebsocketPeer
, when running through theWSLPeer
implementation (anything non HTML5), has an unbound output message buffer.This manifests itself under conditions where outbound traffic on the put_packet() interface under WebSocketPeer exceeds what the far-end can pull out.
The output buffer configuration in
WSLPeer::make_context()
is unused (and actually thep_out_pkt_size
parameter is incorrectly being used to configure the receiving_packet_buffer
size) . This causes the underlying wslaywslay_event_queue_msg()
to indefinitely queue up messages into the internal wslay message queue. This queue is unbound.Steps to reproduce
Send traffic through
WSLPeer::put_packet()
and observe the internal wslay queue length inwslay_queue_push()
.Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered: