Skip to content

Commit

Permalink
Update Rust crate tokio-tungstenite to 0.20 (#4403)
Browse files Browse the repository at this point in the history
Co-authored-by: Rain <[email protected]>
  • Loading branch information
oxide-renovate[bot] and sunshowers authored Nov 22, 2023
1 parent b07a8f5 commit c339fc7
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 40 deletions.
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 @@ -368,7 +368,7 @@ tofino = { git = "http://github.com/oxidecomputer/tofino", branch = "main" }
tokio = "1.34.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 = { version = "0.7.10", features = ["io", "io-util"] }
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: 2 * 1024 * 1024,
..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

0 comments on commit c339fc7

Please sign in to comment.