From 1e538ad6b2758e51a00d142fabd5d0fc6a28281a Mon Sep 17 00:00:00 2001 From: Alexandru Vasile Date: Tue, 22 Oct 2024 15:38:24 +0300 Subject: [PATCH] transport: Fix pending dials leak Signed-off-by: Alexandru Vasile --- src/transport/tcp/mod.rs | 1 + src/transport/websocket/mod.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/transport/tcp/mod.rs b/src/transport/tcp/mod.rs index 856c9410..24e4ef54 100644 --- a/src/transport/tcp/mod.rs +++ b/src/transport/tcp/mod.rs @@ -557,6 +557,7 @@ impl Stream for TcpTransport { Ok(connection) => { let peer = connection.peer(); let endpoint = connection.endpoint(); + self.pending_dials.remove(&connection.connection_id()); self.pending_open.insert(connection.connection_id(), connection); return Poll::Ready(Some(TransportEvent::ConnectionEstablished { diff --git a/src/transport/websocket/mod.rs b/src/transport/websocket/mod.rs index f7999735..03c58191 100644 --- a/src/transport/websocket/mod.rs +++ b/src/transport/websocket/mod.rs @@ -599,6 +599,7 @@ impl Stream for WebSocketTransport { Ok(connection) => { let peer = connection.peer(); let endpoint = connection.endpoint(); + self.pending_dials.remove(&connection.connection_id()); self.pending_open.insert(connection.connection_id(), connection); return Poll::Ready(Some(TransportEvent::ConnectionEstablished {