Skip to content

Commit

Permalink
fix: Remove redundant pinning of futures in connection handler
Browse files Browse the repository at this point in the history
  • Loading branch information
sanity committed Dec 26, 2024
1 parent d5f8d51 commit 61b7609
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions crates/core/src/transport/connection_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,7 @@ impl<S: Socket> UdpPacketsListener<S> {
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 {
match gw_ongoing_connection.await {
Ok(result) => Ok(result),
Err(error) => Err((error, remote_addr))
}
Expand Down Expand Up @@ -381,8 +380,7 @@ impl<S: Socket> UdpPacketsListener<S> {
let task = tokio::spawn({
let span = span!(tracing::Level::DEBUG, "traverse_nat");
async move {
let pinned = Box::pin(ongoing_connection);
match pinned.await {
match ongoing_connection.await {
Ok(result) => Ok(result),
Err(error) => Err((error, remote_addr))
}
Expand Down

0 comments on commit 61b7609

Please sign in to comment.