Skip to content

Commit ac1404e

Browse files
authored
fix(webtransport-websys): Allow poll_flush after poll_close
This removes a `debug_assert` from `poll_flush` because it can be valid for the user to recheck the flush state. In that case the operation should be noop. A real life code that triggers this assertition is [this](https://github.com/libp2p/rust-asynchronous-codec/blob/c818a83906891caf8aadcae8f899727c2c8393a8/src/framed_write.rs#L263-L266). Fixes #5618 Pull-Request: #6193.
1 parent c89444f commit ac1404e

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ libp2p-webrtc-utils = { version = "0.4.0", path = "misc/webrtc-utils" }
114114
libp2p-webrtc-websys = { version = "0.4.0", path = "transports/webrtc-websys" }
115115
libp2p-websocket = { version = "0.45.2", path = "transports/websocket" }
116116
libp2p-websocket-websys = { version = "0.5.0", path = "transports/websocket-websys" }
117-
libp2p-webtransport-websys = { version = "0.5.1", path = "transports/webtransport-websys" }
117+
libp2p-webtransport-websys = { version = "0.5.2", path = "transports/webtransport-websys" }
118118
libp2p-yamux = { version = "0.47.0", path = "muxers/yamux" }
119119

120120
# External dependencies

transports/webtransport-websys/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 0.5.2
2+
3+
- Remove `poll_flush called after poll_close` assertion.
4+
See [PR 6193](https://github.com/libp2p/rust-libp2p/pull/6193).
5+
16
## 0.5.1
27

38
- Remove `once_cell` dependency.

transports/webtransport-websys/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "libp2p-webtransport-websys"
33
edition.workspace = true
44
rust-version = { workspace = true }
55
description = "WebTransport for libp2p under WASM environment"
6-
version = "0.5.1"
6+
version = "0.5.2"
77
authors = [
88
"Yiannis Marangos <[email protected]>",
99
"oblique <[email protected]>",

transports/webtransport-websys/src/stream.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,6 @@ impl StreamInner {
153153
// messages were flushed.
154154
self.poll_writer_ready(cx)
155155
} else {
156-
debug_assert!(
157-
false,
158-
"libp2p_webtransport_websys::Stream: poll_flush called after poll_close"
159-
);
160156
Poll::Ready(Ok(()))
161157
}
162158
}

0 commit comments

Comments
 (0)