Use waker API instead of recursing

This commit is contained in:
Maybe Waffle 2023-09-25 20:45:27 +04:00
parent 808a0cf4fb
commit 2b7eea2679

View file

@ -406,8 +406,10 @@ impl<B: Requester> Stream for PollingStream<'_, B> {
.send(); .send();
this.in_flight.set(Some(req)); this.in_flight.set(Some(req));
// Recurse to poll `self.in_flight` // Immediately wake up to poll `self.in_flight`
self.poll_next(cx) // (without this this stream becomes a zombie)
cx.waker().wake_by_ref();
Poll::Pending
} }
} }