From 1d231f8fd5cb98df09b4b3b491dec9a528e3d45d Mon Sep 17 00:00:00 2001 From: "oxide-renovate[bot]" <146848827+oxide-renovate[bot]@users.noreply.github.com> Date: Wed, 15 Nov 2023 04:08:01 +0000 Subject: [PATCH 1/3] chore(deps): update rust crate tokio-tungstenite to 0.20 --- Cargo.lock | 41 +++++------------------------------------ Cargo.toml | 2 +- 2 files changed, 6 insertions(+), 37 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6b3007b86e..a57958e8f7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2429,7 +2429,7 @@ dependencies = [ "slog-term", "termios", "tokio", - "tokio-tungstenite 0.18.0", + "tokio-tungstenite", "uuid", ] @@ -4553,7 +4553,7 @@ dependencies = [ "thiserror", "tokio", "tokio-stream", - "tokio-tungstenite 0.18.0", + "tokio-tungstenite", "toml 0.8.8", "uuid", ] @@ -6111,7 +6111,7 @@ dependencies = [ "slog", "thiserror", "tokio", - "tokio-tungstenite 0.20.1", + "tokio-tungstenite", "uuid", ] @@ -6141,7 +6141,7 @@ dependencies = [ "slog-term", "thiserror", "tokio", - "tokio-tungstenite 0.20.1", + "tokio-tungstenite", "uuid", ] @@ -8509,18 +8509,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-tungstenite" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54319c93411147bced34cb5609a80e0a8e44c5999c93903a81cd866630ec0bfd" -dependencies = [ - "futures-util", - "log", - "tokio", - "tungstenite 0.18.0", -] - [[package]] name = "tokio-tungstenite" version = "0.20.1" @@ -8530,7 +8518,7 @@ dependencies = [ "futures-util", "log", "tokio", - "tungstenite 0.20.1", + "tungstenite", ] [[package]] @@ -8877,25 +8865,6 @@ dependencies = [ "unicode-width", ] -[[package]] -name = "tungstenite" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ee6ab729cd4cf0fd55218530c4522ed30b7b6081752839b68fcec8d0960788" -dependencies = [ - "base64 0.13.1", - "byteorder", - "bytes", - "http", - "httparse", - "log", - "rand 0.8.5", - "sha1", - "thiserror", - "url", - "utf-8", -] - [[package]] name = "tungstenite" version = "0.20.1" diff --git a/Cargo.toml b/Cargo.toml index c51ac069a9..d12df8f1f4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" From 555aa2defbaa22ee73e8050eb40b916efbd09c0f Mon Sep 17 00:00:00 2001 From: Rain Date: Sun, 19 Nov 2023 16:46:48 -0800 Subject: [PATCH 2/3] fix build --- gateway/src/serial_console.rs | 8 ++++++-- gateway/tests/integration_tests/serial_console.rs | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gateway/src/serial_console.rs b/gateway/src/serial_console.rs index eb6183fdfb..ecad5b7e67 100644 --- a/gateway/src/serial_console.rs +++ b/gateway/src/serial_console.rs @@ -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, + ..Default::default() + }; let ws_stream = WebSocketStream::from_raw_socket(upgraded, Role::Server, Some(config)) .await; diff --git a/gateway/tests/integration_tests/serial_console.rs b/gateway/tests/integration_tests/serial_console.rs index 9ab26bef4a..11cb9674a7 100644 --- a/gateway/tests/integration_tests/serial_console.rs +++ b/gateway/tests/integration_tests/serial_console.rs @@ -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"), From bda14215e288c828c8d2777829925f71ece83bbe Mon Sep 17 00:00:00 2001 From: Rain Date: Tue, 21 Nov 2023 16:48:44 -0800 Subject: [PATCH 3/3] address review comment --- gateway/src/serial_console.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gateway/src/serial_console.rs b/gateway/src/serial_console.rs index ecad5b7e67..3e49f8526a 100644 --- a/gateway/src/serial_console.rs +++ b/gateway/src/serial_console.rs @@ -51,7 +51,7 @@ pub(crate) async fn run( 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, + max_write_buffer_size: 2 * 1024 * 1024, ..Default::default() }; let ws_stream =