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

Update tungstenite crates to 0.20 #534

Merged
merged 1 commit into from
Sep 28, 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
23 changes: 6 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ syn = "1.0"
tempfile = "3.2"
thiserror = "1.0"
tokio = "1"
tokio-tungstenite = "0.17"
tokio-tungstenite = "0.20"
tokio-util = "0.7"
toml = "0.7.6"
tracing = "0.1.35"
Expand Down
8 changes: 6 additions & 2 deletions bin/propolis-server/src/lib/mock_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,12 @@ async fn instance_serial(
query: Query<api::InstanceSerialConsoleStreamRequest>,
websock: WebsocketConnection,
) -> dropshot::WebsocketChannelResult {
let config =
WebSocketConfig { max_send_queue: Some(4096), ..Default::default() };
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 mut ws_stream = WebSocketStream::from_raw_socket(
websock.into_inner(),
Role::Server,
Expand Down
9 changes: 7 additions & 2 deletions bin/propolis-server/src/lib/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -831,8 +831,13 @@ async fn instance_serial(
let vm = ctx.vm().await?;
let serial = vm.com1().clone();

let config =
WebSocketConfig { max_send_queue: Some(4096), ..Default::default() };
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()
};
let mut ws_stream = WebSocketStream::from_raw_socket(
websock.into_inner(),
Role::Server,
Expand Down
11 changes: 7 additions & 4 deletions lib/propolis-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ pub mod support {
.send()
.await
.map_err(|e| {
WSError::Http(http::Response::new(Some(e.to_string())))
WSError::Http(http::Response::new(Some(
e.to_string().into_bytes(),
)))
})?
.into_inner();

Expand Down Expand Up @@ -190,9 +192,10 @@ pub mod support {
tokio::time::sleep(delay).await;
Ok(Box::new(stream))
} else {
Err(WSError::Http(http::Response::new(Some(format!(
"no duplex connection found for address {address}"
)))))
Err(WSError::Http(http::Response::new(Some(
format!("no duplex connection found for address {address}")
.into_bytes(),
))))
}
}
}
Expand Down