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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions bin/propolis-server/src/lib/mock_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,7 @@ async fn instance_serial(
query: Query<api::InstanceSerialConsoleStreamRequest>,
websock: WebsocketConnection,
) -> dropshot::WebsocketChannelResult {
let config = WebSocketConfig {
// tune the buffer size limits down (compared to the defaults)
write_buffer_size: 4096,
max_write_buffer_size: 8192,
..Default::default()
};
let config = WebSocketConfig::default();
let mut ws_stream = WebSocketStream::from_raw_socket(
websock.into_inner(),
Role::Server,
Expand Down
14 changes: 7 additions & 7 deletions bin/propolis-server/src/lib/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -831,13 +831,13 @@ async fn instance_serial(
let vm = ctx.vm().await?;
let serial = vm.com1().clone();

let config = WebSocketConfig {
// tune the buffer size limits down (compared to the defaults)
// TODO: tuning for this could be explored
write_buffer_size: 4096,
max_write_buffer_size: 8192,
..Default::default()
};
// Use the default buffering paramters for the websocket configuration
//
// Because messages are written with [`StreamExt::send`], the buffer on the
// websocket is flushed for every message, preventing both unecessary delays
// of messages and the potential for the buffer to grow without bound.
let config = WebSocketConfig::default();

let mut ws_stream = WebSocketStream::from_raw_socket(
websock.into_inner(),
Role::Server,
Expand Down
Loading