Skip to content

Commit d9418ad

Browse files
Bump tokio-tungstenite from 0.24.0 to 0.26.1 (#2639)
* Bump tokio-tungstenite from 0.24.0 to 0.26.1 Bumps [tokio-tungstenite](https://github.com/snapview/tokio-tungstenite) from 0.24.0 to 0.26.1. - [Changelog](https://github.com/snapview/tokio-tungstenite/blob/master/CHANGELOG.md) - [Commits](snapview/tokio-tungstenite@v0.24.0...v0.26.1) --- updated-dependencies: - dependency-name: tokio-tungstenite dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * Fix breaking changes --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Guillaume Lagrange <[email protected]>
1 parent fea5e57 commit d9418ad

File tree

3 files changed

+54
-23
lines changed

3 files changed

+54
-23
lines changed

Cargo.lock

+33-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/burn-remote/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ futures-util = { version = "0.3" }
3636

3737
# Client dependencies
3838
async-channel = { workspace = true, optional = true }
39-
tokio-tungstenite = { version = "0.24", optional = true }
39+
tokio-tungstenite = { version = "0.26", optional = true }
4040

4141
# Server dependencies
4242
axum = { version = "0.7.9", features = ["ws"], optional = true }

crates/burn-remote/src/client/worker.rs

+20-19
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use crate::shared::{ConnectionId, SessionId, Task, TaskResponse, TaskResponseCon
33
use futures_util::{SinkExt, StreamExt};
44
use std::{collections::HashMap, sync::Arc};
55
use tokio_tungstenite::{
6-
connect_async_with_config,
6+
connect_async_with_config, tungstenite,
77
tungstenite::protocol::{Message, WebSocketConfig},
88
};
99

@@ -56,28 +56,29 @@ impl ClientWorker {
5656
log::info!("Connecting to {address_request} ...");
5757
let (mut stream_request, _) = connect_async_with_config(
5858
address_request.clone(),
59-
Some(WebSocketConfig {
60-
max_send_queue: None,
61-
write_buffer_size: 0,
62-
max_write_buffer_size: usize::MAX,
63-
max_message_size: None,
64-
max_frame_size: Some(MB * 512),
65-
accept_unmasked_frames: true,
66-
}),
59+
Some(
60+
WebSocketConfig::default()
61+
.write_buffer_size(0)
62+
.max_message_size(None)
63+
.max_frame_size(Some(MB * 512))
64+
.accept_unmasked_frames(true)
65+
.read_buffer_size(64 * 1024) // 64 KiB (previous default)
66+
),
6767
true,
6868
)
6969
.await
7070
.expect("Failed to connect");
7171
let (mut stream_response, _) = connect_async_with_config(
7272
address_response,
73-
Some(WebSocketConfig {
74-
max_send_queue: None,
75-
write_buffer_size: 0,
76-
max_write_buffer_size: usize::MAX,
77-
max_message_size: None,
78-
max_frame_size: Some(MB * 512),
79-
accept_unmasked_frames: true,
80-
}),
73+
Some(
74+
WebSocketConfig::default()
75+
.write_buffer_size(0)
76+
.max_message_size(None)
77+
.max_frame_size(Some(MB * 512))
78+
.accept_unmasked_frames(true)
79+
.read_buffer_size(64 * 1024) // 64 KiB (previous default)
80+
81+
),
8182
true,
8283
)
8384
.await
@@ -87,7 +88,7 @@ impl ClientWorker {
8788

8889
// Init the connection.
8990
let session_id = SessionId::new();
90-
let bytes = rmp_serde::to_vec(&Task::Init(session_id)).expect("Can serialize tasks to bytes.");
91+
let bytes: tungstenite::Bytes = rmp_serde::to_vec(&Task::Init(session_id)).expect("Can serialize tasks to bytes.").into();
9192
stream_request.send(Message::Binary(bytes.clone())).await.expect("Can send the message on the websocket.");
9293
stream_response.send(Message::Binary(bytes)).await.expect("Can send the message on the websocket.");
9394

@@ -129,7 +130,7 @@ impl ClientWorker {
129130
ClientRequest::WithoutCallback(task) => task,
130131

131132
};
132-
let bytes = rmp_serde::to_vec(&task).expect("Can serialize tasks to bytes.");
133+
let bytes = rmp_serde::to_vec(&task).expect("Can serialize tasks to bytes.").into();
133134
stream_request.send(Message::Binary(bytes)).await.expect("Can send the message on the websocket.");
134135
}
135136
});

0 commit comments

Comments
 (0)