From a02abcbac55092cc41bebcae6a01c6076983d96a Mon Sep 17 00:00:00 2001 From: Thomas Eizinger Date: Wed, 4 Oct 2023 10:59:12 +1100 Subject: [PATCH] deps(phoenix-channel): upgrade `tokio-tungstenite` (#2230) Resolves: #2200. --- rust/Cargo.lock | 51 ++++++--------------------------- rust/phoenix-channel/Cargo.toml | 2 +- rust/phoenix-channel/src/lib.rs | 5 ++++ 3 files changed, 14 insertions(+), 44 deletions(-) diff --git a/rust/Cargo.lock b/rust/Cargo.lock index aa26d974c..20b77a842 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -1189,7 +1189,7 @@ dependencies = [ "serde_json", "time", "tokio", - "tokio-tungstenite 0.20.1", + "tokio-tungstenite", "tokio-util", "tracing", "tracing-android", @@ -1215,7 +1215,7 @@ dependencies = [ "serde", "serde_json", "tokio", - "tokio-tungstenite 0.20.1", + "tokio-tungstenite", "tracing", "url", "webrtc", @@ -1902,7 +1902,7 @@ dependencies = [ "thiserror", "tokio", "tokio-stream", - "tokio-tungstenite 0.20.1", + "tokio-tungstenite", "tracing", "tracing-android", "tracing-appender", @@ -2454,7 +2454,7 @@ dependencies = [ "serde_json", "thiserror", "tokio", - "tokio-tungstenite 0.19.0", + "tokio-tungstenite", "tracing", "url", ] @@ -2985,7 +2985,7 @@ dependencies = [ "log", "ring 0.16.20", "sct 0.6.1", - "webpki 0.21.4", + "webpki", ] [[package]] @@ -3680,21 +3680,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-tungstenite" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec509ac96e9a0c43427c74f003127d953a265737636129424288d27cb5c4b12c" -dependencies = [ - "futures-util", - "log", - "rustls 0.21.7", - "rustls-native-certs", - "tokio", - "tokio-rustls", - "tungstenite 0.19.0", -] - [[package]] name = "tokio-tungstenite" version = "0.20.1" @@ -3704,9 +3689,10 @@ dependencies = [ "futures-util", "log", "rustls 0.21.7", + "rustls-native-certs", "tokio", "tokio-rustls", - "tungstenite 0.20.1", + "tungstenite", "webpki-roots", ] @@ -3980,27 +3966,6 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" -[[package]] -name = "tungstenite" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15fba1a6d6bb030745759a9a2a588bfe8490fc8b4751a277db3a0be1c9ebbf67" -dependencies = [ - "byteorder", - "bytes", - "data-encoding", - "http", - "httparse", - "log", - "rand", - "rustls 0.21.7", - "sha1 0.10.6", - "thiserror", - "url", - "utf-8", - "webpki 0.22.2", -] - [[package]] name = "tungstenite" version = "0.20.1" @@ -4401,7 +4366,7 @@ dependencies = [ "subtle", "thiserror", "tokio", - "webpki 0.21.4", + "webpki", "webrtc-util", "x25519-dalek", "x509-parser 0.13.2", diff --git a/rust/phoenix-channel/Cargo.toml b/rust/phoenix-channel/Cargo.toml index 7881d7701..0f7ad0ec1 100644 --- a/rust/phoenix-channel/Cargo.toml +++ b/rust/phoenix-channel/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" [dependencies] secrecy = { workspace = true } -tokio-tungstenite = { version = "0.19", features = ["rustls-tls-native-roots"] } +tokio-tungstenite = { version = "0.20.1", features = ["rustls-tls-native-roots"] } futures = "0.3.28" base64 = "0.21.4" serde = { version = "1.0.188", features = ["derive"] } diff --git a/rust/phoenix-channel/src/lib.rs b/rust/phoenix-channel/src/lib.rs index ecaad99b5..51f981ad0 100644 --- a/rust/phoenix-channel/src/lib.rs +++ b/rust/phoenix-channel/src/lib.rs @@ -232,6 +232,11 @@ where return Poll::Ready(Ok(Event::HeartbeatSent)); } + // Priority 4: Flush out. + if self.stream.poll_flush_unpin(cx)?.is_ready() { + tracing::trace!("Flushed websocket") + } + return Poll::Pending; } }