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

Fix tungstenite buffering parameters for uart WS #541

Merged
merged 1 commit into from
Oct 6, 2023

Conversation

pfmooney
Copy link
Collaborator

@pfmooney pfmooney commented Oct 6, 2023

When tungstenite was updated to 0.20.x, the structure of the buffering parameters exposed by its websocket configuration changed significantly. The parameters chosen can cause WriteBufferFull errors if enough output accumulates in the history buffer to be sent in a message which exceeds the unnecessarily small max_write_buffer_size.

Using the configuration defaults, which feature an unbounded max_write_buffer_size, should provide acceptable behavior.

Fixes #540

@pfmooney pfmooney requested a review from leftwo October 6, 2023 01:37
Copy link
Contributor

@leftwo leftwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, the usize::MAX is probably large enough.

impl Default for WebSocketConfig {
    fn default() -> Self {
        #[allow(deprecated)]
        WebSocketConfig {
            max_send_queue: None,
            write_buffer_size: 128 * 1024,
            max_write_buffer_size: usize::MAX,
            max_message_size: Some(64 << 20),
            max_frame_size: Some(16 << 20),
            accept_unmasked_frames: false,
        }
    }
}

When tungstenite was updated to 0.20.x, the structure of the buffering
parameters exposed by its websocket configuration changed significantly.
The parameters chosen can cause `WriteBufferFull` errors if enough
output accumulates in the history buffer to be sent in a message which
exceeds the unnecessarily small `max_write_buffer_size`.

Using the configuration defaults, which feature an unbounded
`max_write_buffer_size`, should provide acceptable behavior.

Fixes oxidecomputer#540
@pfmooney pfmooney merged commit 901b710 into oxidecomputer:master Oct 6, 2023
10 checks passed
@pfmooney pfmooney deleted the uart-buffer-size branch October 6, 2023 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Serial console: WriteBufferFull error
2 participants