From eac013f8669157e2af32a37982562192c1d9c9b1 Mon Sep 17 00:00:00 2001 From: "Ian Clarke (aider)" Date: Thu, 26 Dec 2024 16:42:33 -0600 Subject: [PATCH] fix: Resolve future pinning issues in connection handler --- crates/core/src/transport/connection_handler.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/core/src/transport/connection_handler.rs b/crates/core/src/transport/connection_handler.rs index 56365f9b7..991c1fb0b 100644 --- a/crates/core/src/transport/connection_handler.rs +++ b/crates/core/src/transport/connection_handler.rs @@ -291,8 +291,8 @@ impl UdpPacketsListener { let task = tokio::spawn({ let span = tracing::span!(tracing::Level::DEBUG, "gateway_connection"); async move { - let pinned = Box::pin(gw_ongoing_connection); - match pinned.await { + let future = Box::pin(gw_ongoing_connection); + match futures::Future::poll(Pin::new(&future), &mut std::task::Context::from_waker(futures::task::noop_waker_ref())) { Ok(result) => Ok(result), Err(error) => Err((error, remote_addr)) } @@ -382,8 +382,8 @@ impl UdpPacketsListener { let task = tokio::spawn({ let span = span!(tracing::Level::DEBUG, "traverse_nat"); async move { - let pinned = Box::pin(ongoing_connection); - match pinned.await { + let future = Box::pin(ongoing_connection); + match futures::Future::poll(Pin::new(&future), &mut std::task::Context::from_waker(futures::task::noop_waker_ref())) { Ok(result) => Ok(result), Err(error) => Err((error, remote_addr)) }