Skip to content

Commit 6e40fbb

Browse files
authored
websocket/stream: Fix unexpected EOF on Poll::Pending state poisoning (#327)
This PR updates the following dependencies: - tokio tungstenite - URL crate to facilitate the new tungstenite version The tokio tungstenite update changed the API of webscoket messages, which motivated the following changes: - When`poll_ready` or `poll_flush` returned `Poll::Pending`, the websocket state would forever remain poisoned. - This has the side effect of returning `UnexpectedEof` on consecutive calls, which led to the connection being terminated - The state machine of the websocket is simplified to just 3 states - Writer buffer and pointer are merged under one BytesMut instance - `poll_read` implementation is simplified as well to make the code more readable --------- Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
1 parent f6d02ff commit 6e40fbb

File tree

3 files changed

+175
-70
lines changed

3 files changed

+175
-70
lines changed

Cargo.lock

Lines changed: 125 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@ socket2 = { version = "0.5.8", features = ["all"] }
3939
str0m = { version = "0.6.2", optional = true }
4040
thiserror = "2.0.11"
4141
tokio-stream = "0.1.12"
42-
tokio-tungstenite = { version = "0.20.0", features = ["rustls-tls-native-roots"], optional = true }
42+
tokio-tungstenite = { version = "0.26.1", features = ["rustls-tls-native-roots", "url"], optional = true }
4343
tokio-util = { version = "0.7.11", features = ["compat", "io", "codec"] }
4444
tokio = { version = "1.26.0", features = ["rt", "net", "io-util", "time", "macros", "sync", "parking_lot"] }
4545
tracing = { version = "0.1.40", features = ["log"] }
4646
hickory-resolver = "0.24.2"
4747
uint = "0.10.0"
4848
unsigned-varint = { version = "0.8.0", features = ["codec"] }
49-
url = "2.4.0"
49+
url = "2.5.4"
5050
webpki = { version = "0.22.4", optional = true }
5151
x25519-dalek = "2.0.1"
5252
x509-parser = "0.17.0"

0 commit comments

Comments
 (0)