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 Rust crate tokio-tungstenite to 0.20 #4403

Merged
merged 5 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from 3 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
41 changes: 5 additions & 36 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 @@ -366,7 +366,7 @@ tofino = { git = "http://github.com/oxidecomputer/tofino", branch = "main" }
tokio = "1.33.0"
tokio-postgres = { version = "0.7", features = [ "with-chrono-0_4", "with-uuid-1" ] }
tokio-stream = "0.1.14"
tokio-tungstenite = "0.18"
tokio-tungstenite = "0.20"
tokio-util = "0.7.10"
toml = "0.8.8"
toml_edit = "0.21.0"
Expand Down
8 changes: 6 additions & 2 deletions gateway/src/serial_console.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,12 @@ pub(crate) async fn run(
log: Logger,
) -> WebsocketChannelResult {
let upgraded = conn.into_inner();
let config =
WebSocketConfig { max_send_queue: Some(4096), ..Default::default() };
let config = WebSocketConfig {
// Maintain a max write buffer size of 2 MB (this is only relevant if
// writes are failing).
max_write_buffer_size: 1 << 21,
sunshowers marked this conversation as resolved.
Show resolved Hide resolved
..Default::default()
};
let ws_stream =
WebSocketStream::from_raw_socket(upgraded, Role::Server, Some(config))
.await;
Expand Down
3 changes: 2 additions & 1 deletion gateway/tests/integration_tests/serial_console.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,12 @@ async fn serial_console_detach() {
}
tungstenite::Error::ConnectionClosed
| tungstenite::Error::AlreadyClosed
| tungstenite::Error::AttackAttempt
| tungstenite::Error::Io(_)
| tungstenite::Error::Tls(_)
| tungstenite::Error::Capacity(_)
| tungstenite::Error::Protocol(_)
| tungstenite::Error::SendQueueFull(_)
| tungstenite::Error::WriteBufferFull(_)
| tungstenite::Error::Utf8
| tungstenite::Error::Url(_)
| tungstenite::Error::HttpFormat(_) => panic!("unexpected error"),
Expand Down
Loading