From fae0692f907de55a931b0b44af5573340045c601 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Frosteg=C3=A5rd?= Date: Mon, 16 Aug 2021 23:22:56 +0200 Subject: [PATCH] Upgrade tungstenite --- Cargo.lock | 15 ++------------- aquatic_ws/Cargo.toml | 2 +- aquatic_ws/src/lib/network/connection.rs | 6 +++--- aquatic_ws_load_test/Cargo.toml | 2 +- aquatic_ws_protocol/Cargo.toml | 2 +- 5 files changed, 8 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 19829c4..e66e4cd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -790,15 +790,6 @@ dependencies = [ "regex", ] -[[package]] -name = "input_buffer" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f97967975f448f1a7ddb12b0bc41069d09ed6a1c161a92687e057325db35d413" -dependencies = [ - "bytes", -] - [[package]] name = "instant" version = "0.1.10" @@ -1673,18 +1664,16 @@ dependencies = [ [[package]] name = "tungstenite" -version = "0.13.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fe8dada8c1a3aeca77d6b51a4f1314e0f4b8e438b7b1b71e3ddaca8080e4093" +checksum = "983d40747bce878d2fb67d910dcb8bd3eca2b2358540c3cc1b98c027407a3ae3" dependencies = [ "base64", "byteorder", "bytes", "http", "httparse", - "input_buffer", "log", - "native-tls", "rand", "sha-1", "thiserror", diff --git a/aquatic_ws/Cargo.toml b/aquatic_ws/Cargo.toml index b5597e8..1087208 100644 --- a/aquatic_ws/Cargo.toml +++ b/aquatic_ws/Cargo.toml @@ -34,7 +34,7 @@ privdrop = "0.5" rand = { version = "0.8", features = ["small_rng"] } serde = { version = "1", features = ["derive"] } socket2 = { version = "0.4.1", features = ["all"] } -tungstenite = "0.13" +tungstenite = "0.15" [dev-dependencies] quickcheck = "1.0" diff --git a/aquatic_ws/src/lib/network/connection.rs b/aquatic_ws/src/lib/network/connection.rs index a8a8d5c..fbaf299 100644 --- a/aquatic_ws/src/lib/network/connection.rs +++ b/aquatic_ws/src/lib/network/connection.rs @@ -9,7 +9,7 @@ use mio::{Poll, Token}; use native_tls::{MidHandshakeTlsStream, TlsAcceptor, TlsStream}; use tungstenite::handshake::{server::NoCallback, HandshakeError, MidHandshake}; use tungstenite::protocol::WebSocketConfig; -use tungstenite::server::ServerHandshake; +use tungstenite::ServerHandshake; use tungstenite::WebSocket; use crate::common::*; @@ -111,7 +111,7 @@ impl HandshakeMachine { if let Some(tls_acceptor) = opt_tls_acceptor { Self::handle_tls_handshake_result(tls_acceptor.accept(stream)) } else { - let handshake_result = ::tungstenite::server::accept_with_config( + let handshake_result = ::tungstenite::accept_with_config( Stream::TcpStream(stream), Some(ws_config), ); @@ -120,7 +120,7 @@ impl HandshakeMachine { } } HandshakeMachine::TlsStream(stream) => { - let handshake_result = ::tungstenite::server::accept(Stream::TlsStream(stream)); + let handshake_result = ::tungstenite::accept(Stream::TlsStream(stream)); Self::handle_ws_handshake_result(handshake_result) } diff --git a/aquatic_ws_load_test/Cargo.toml b/aquatic_ws_load_test/Cargo.toml index 54a5923..abf14ab 100644 --- a/aquatic_ws_load_test/Cargo.toml +++ b/aquatic_ws_load_test/Cargo.toml @@ -21,7 +21,7 @@ rand_distr = "0.4" serde = { version = "1", features = ["derive"] } serde_json = "1" slab = "0.4" -tungstenite = "0.13" +tungstenite = "0.15" [dev-dependencies] quickcheck = "1.0" diff --git a/aquatic_ws_protocol/Cargo.toml b/aquatic_ws_protocol/Cargo.toml index 5817ffc..1830725 100644 --- a/aquatic_ws_protocol/Cargo.toml +++ b/aquatic_ws_protocol/Cargo.toml @@ -22,7 +22,7 @@ hashbrown = { version = "0.11.2", features = ["serde"] } serde = { version = "1", features = ["derive"] } serde_json = "1" simd-json = { version = "0.4.7", features = ["allow-non-simd"] } -tungstenite = "0.13" +tungstenite = "0.15" [dev-dependencies] criterion = "0.3"