Skip to content
This repository was archived by the owner on Aug 23, 2022. It is now read-only.

Commit 097f65d

Browse files
authored
[PollStream] reset shutdown_fut future after done (#32)
* [PollStream] reset shutdown_fut future after done fixes "async fn resumed after completion" panics, which occurs if you call poll_shutdown after it has returned Poll::Ready once. * bump min version fixes "error: package `os_str_bytes v6.2.0` cannot be built because it requires rustc 1.57.0 or newer, while the currently active rustc version is 1.56.1"
1 parent 24aca40 commit 097f65d

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

.github/workflows/cargo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
matrix:
1717
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
1818
toolchain:
19-
- 1.56.1 # min supported version (https://github.com/webrtc-rs/webrtc/#toolchain)
19+
- 1.57.0 # min supported version (https://github.com/webrtc-rs/webrtc/#toolchain)
2020
- stable
2121
runs-on: ${{ matrix.os }}
2222
steps:

src/stream/mod.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -772,8 +772,14 @@ impl AsyncWrite for PollStream {
772772

773773
match fut.as_mut().poll(cx) {
774774
Poll::Pending => Poll::Pending,
775-
Poll::Ready(Err(e)) => Poll::Ready(Err(e.into())),
776-
Poll::Ready(Ok(_)) => Poll::Ready(Ok(())),
775+
Poll::Ready(Err(e)) => {
776+
self.shutdown_fut = None;
777+
Poll::Ready(Err(e.into()))
778+
}
779+
Poll::Ready(Ok(_)) => {
780+
self.shutdown_fut = None;
781+
Poll::Ready(Ok(()))
782+
}
777783
}
778784
}
779785
}

0 commit comments

Comments
 (0)