drop permit reserved by poll_reserve (#1858)

This commit is contained in:
Luna Yao authored and GitHub committed 2026-02-03 11:14:11 +08:00
1 parent 1e2124cb99
commit aebb7facfa
1 file changed
+8 -4
+8 -4
View File
@@ -78,10 +78,14 @@ impl UdpPoller for QuicSocketPoller {
self: Pin<&mut Self>,
cx: &mut std::task::Context,
) -> Poll<std::io::Result<()>> {
self.get_mut()
.tx
.poll_reserve(cx)
.map_err(|e| std::io::Error::new(std::io::ErrorKind::BrokenPipe, e))
let tx = &mut self.get_mut().tx;
let poll = tx.poll_reserve(cx);
if let Poll::Ready(Ok(_)) = poll {
tx.abort_send();
}
poll.map_err(|e| std::io::Error::new(std::io::ErrorKind::BrokenPipe, e))
}
}