Skip to content

Commit bcd8110

Browse files
authored
Merge branch 'main' into ci-heaptrack-job
2 parents a3b5d95 + 3ab5cd7 commit bcd8110

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ pin-project-lite = "0.2.13"
3939
tracing-subscriber = { version = "0.3.17", features = ["env-filter"] }
4040
criterion = { version = "0.5.1", features = ["html_reports"] }
4141
axum = "0.7.2"
42-
salvo = { version = "0.65.0", features = ["tower-compat"] }
42+
salvo = { version = "0.66.0", features = ["tower-compat"] }
4343
rust_socketio = { version = "0.4.2", features = ["async"] }

engineioxide/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ http-body-util.workspace = true
3333
pin-project-lite.workspace = true
3434
hyper-util = { workspace = true, features = ["tokio"] }
3535

36-
base64 = "0.21.0"
36+
base64 = "0.22.0"
3737
bytes = "1.4.0"
3838
rand = "0.8.5"
3939

engineioxide/src/transport/ws.rs

+10-2
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,11 @@ where
182182
}
183183
p => return Err(Error::BadPacket(p)),
184184
},
185-
Message::Binary(data) => {
185+
Message::Binary(mut data) => {
186+
if socket.protocol == ProtocolVersion::V3 && !data.is_empty() {
187+
// The first byte is the message type, which we don't need.
188+
let _ = data.remove(0);
189+
}
186190
engine.handler.on_binary(data, socket.clone());
187191
Ok(())
188192
}
@@ -212,7 +216,11 @@ where
212216
macro_rules! map_fn {
213217
($item:ident) => {
214218
let res = match $item {
215-
Packet::Binary(bin) | Packet::BinaryV3(bin) => {
219+
Packet::Binary(mut bin) | Packet::BinaryV3(mut bin) => {
220+
if socket.protocol == ProtocolVersion::V3 {
221+
// v3 protocol requires packet type as the first byte
222+
bin.insert(0, 0x04);
223+
}
216224
tx.feed(Message::Binary(bin)).await
217225
}
218226
Packet::Close => {

0 commit comments

Comments
 (0)