Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(quic): Wake transport when adding a new dialer or listener #3342

Merged
merged 12 commits into from
Jan 23, 2023
Prev Previous commit
Next Next commit
fix(quic): better Transport::poll structure
  • Loading branch information
elenaf9 committed Jan 20, 2023
commit 7cdaee7897cfbbb83b51f7ecb800f4c9220941ed
10 changes: 6 additions & 4 deletions transports/quic/src/transport.rs
Original file line number Diff line number Diff line change
@@ -212,17 +212,19 @@ impl<P: Provider> Transport for GenTransport<P> {
errored.push(*key);
}
}
self.waker = Some(cx.waker().clone());

for key in errored {
// Endpoint driver of dialer crashed.
// Drop dialer and all pending dials so that the connection receiver is notified.
self.dialer.remove(&key);
}
match self.listeners.poll_next_unpin(cx) {
Poll::Ready(Some(ev)) => Poll::Ready(ev),
_ => Poll::Pending,

if let Poll::Ready(Some(ev)) = self.listeners.poll_next_unpin(cx) {
return Poll::Ready(ev);
}

self.waker = Some(cx.waker().clone());
Poll::Pending
}
}