mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-03-31 17:55:36 +00:00
Update async-tungstenite version
This commit is contained in:
parent
edc85a0f66
commit
34902048d9
6 changed files with 25 additions and 386 deletions
|
|
@ -33,7 +33,7 @@ aquatic_toml_config.workspace = true
|
|||
aquatic_ws_protocol.workspace = true
|
||||
|
||||
anyhow = "1"
|
||||
async-tungstenite = "0.25"
|
||||
async-tungstenite = "0.28"
|
||||
arc-swap = "1"
|
||||
cfg-if = "1"
|
||||
futures = "0.3"
|
||||
|
|
@ -53,7 +53,7 @@ signal-hook = { version = "0.3" }
|
|||
slab = "0.4"
|
||||
slotmap = "1"
|
||||
socket2 = { version = "0.5", features = ["all"] }
|
||||
tungstenite = "0.21"
|
||||
tungstenite = "0.24"
|
||||
|
||||
# metrics feature
|
||||
metrics = { version = "0.24", optional = true }
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ aquatic_toml_config.workspace = true
|
|||
aquatic_ws_protocol.workspace = true
|
||||
|
||||
anyhow = "1"
|
||||
async-tungstenite = "0.25"
|
||||
async-tungstenite = "0.28"
|
||||
futures = "0.3"
|
||||
futures-rustls = "0.26"
|
||||
glommio = "0.9"
|
||||
|
|
@ -31,7 +31,7 @@ rand_distr = "0.4"
|
|||
rustls = { version = "0.23" }
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
tungstenite = "0.21"
|
||||
tungstenite = "0.24"
|
||||
|
||||
[dev-dependencies]
|
||||
quickcheck = "1"
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@ anyhow = "1"
|
|||
hashbrown = { version = "0.15", features = ["serde"] }
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
simd-json = "0.13"
|
||||
tungstenite = { version = "0.21", optional = true }
|
||||
simd-json = "0.14"
|
||||
tungstenite = { version = "0.24", optional = true }
|
||||
|
||||
[dev-dependencies]
|
||||
criterion = "0.5"
|
||||
|
|
|
|||
|
|
@ -28,11 +28,13 @@ impl InMessage {
|
|||
|
||||
match ws_message {
|
||||
Message::Text(text) => {
|
||||
let mut text: Vec<u8> = text.into();
|
||||
let mut text: Vec<u8> = text.as_bytes().to_owned();
|
||||
|
||||
::simd_json::serde::from_slice(&mut text).context("deserialize with serde")
|
||||
}
|
||||
Message::Binary(mut bytes) => {
|
||||
Message::Binary(bytes) => {
|
||||
let mut bytes = bytes.to_vec();
|
||||
|
||||
::simd_json::serde::from_slice(&mut bytes[..]).context("deserialize with serde")
|
||||
}
|
||||
_ => Err(anyhow::anyhow!("Message is neither text nor binary")),
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@ impl OutMessage {
|
|||
use tungstenite::Message::{Binary, Text};
|
||||
|
||||
let mut text: Vec<u8> = match message {
|
||||
Text(text) => text.into(),
|
||||
Binary(bytes) => String::from_utf8(bytes)?.into(),
|
||||
Text(text) => text.as_bytes().to_owned(),
|
||||
Binary(bytes) => String::from_utf8(bytes.to_vec())?.into(),
|
||||
_ => return Err(anyhow::anyhow!("Message is neither text nor bytes")),
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue