We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b109803 commit 48d5105Copy full SHA for 48d5105
src/client.rs
@@ -1437,8 +1437,14 @@ where
1437
1438
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
1439
self.inner.maybe_close_connection_if_no_streams();
1440
+ let had_streams_or_refs = self.inner.has_streams_or_other_references();
1441
let result = self.inner.poll(cx).map_err(Into::into);
- if result.is_pending() && !self.inner.has_streams_or_other_references() {
1442
+ // if we had streams/refs, and don't anymore, wake up one more time to
1443
+ // ensure proper shutdown
1444
+ if result.is_pending()
1445
+ && had_streams_or_refs
1446
+ && !self.inner.has_streams_or_other_references()
1447
+ {
1448
tracing::trace!("last stream closed during poll, wake again");
1449
cx.waker().wake_by_ref();
1450
}
0 commit comments