From d5f8d51da902846bc77da6d276c7c9838ba69a81 Mon Sep 17 00:00:00 2001 From: "Ian Clarke (aider)" Date: Thu, 26 Dec 2024 16:48:35 -0600 Subject: [PATCH] fix: Pin boxed futures before awaiting in connection handler --- crates/core/src/transport/connection_handler.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/core/src/transport/connection_handler.rs b/crates/core/src/transport/connection_handler.rs index bb415b2f7..a7f970b7a 100644 --- a/crates/core/src/transport/connection_handler.rs +++ b/crates/core/src/transport/connection_handler.rs @@ -291,7 +291,8 @@ impl UdpPacketsListener { let task = tokio::spawn({ let span = tracing::span!(tracing::Level::DEBUG, "gateway_connection"); async move { - match gw_ongoing_connection.await { + let pinned = Box::pin(gw_ongoing_connection); + match pinned.await { Ok(result) => Ok(result), Err(error) => Err((error, remote_addr)) } @@ -380,7 +381,8 @@ impl UdpPacketsListener { let task = tokio::spawn({ let span = span!(tracing::Level::DEBUG, "traverse_nat"); async move { - match ongoing_connection.await { + let pinned = Box::pin(ongoing_connection); + match pinned.await { Ok(result) => Ok(result), Err(error) => Err((error, remote_addr)) }