File tree 3 files changed +12
-4
lines changed
3 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -39,5 +39,5 @@ pin-project-lite = "0.2.13"
39
39
tracing-subscriber = { version = " 0.3.17" , features = [" env-filter" ] }
40
40
criterion = { version = " 0.5.1" , features = [" html_reports" ] }
41
41
axum = " 0.7.2"
42
- salvo = { version = " 0.65 .0" , features = [" tower-compat" ] }
42
+ salvo = { version = " 0.66 .0" , features = [" tower-compat" ] }
43
43
rust_socketio = { version = " 0.4.2" , features = [" async" ] }
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ http-body-util.workspace = true
33
33
pin-project-lite.workspace = true
34
34
hyper-util = { workspace = true , features = [" tokio" ] }
35
35
36
- base64 = " 0.21 .0"
36
+ base64 = " 0.22 .0"
37
37
bytes = " 1.4.0"
38
38
rand = " 0.8.5"
39
39
Original file line number Diff line number Diff line change @@ -182,7 +182,11 @@ where
182
182
}
183
183
p => return Err ( Error :: BadPacket ( p) ) ,
184
184
} ,
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
+ }
186
190
engine. handler . on_binary ( data, socket. clone ( ) ) ;
187
191
Ok ( ( ) )
188
192
}
@@ -212,7 +216,11 @@ where
212
216
macro_rules! map_fn {
213
217
( $item: ident) => {
214
218
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
+ }
216
224
tx. feed( Message :: Binary ( bin) ) . await
217
225
}
218
226
Packet :: Close => {
You can’t perform that action at this time.
0 commit comments