diff --git a/libs/hbb_common b/libs/hbb_common index 98d256d1b..4867575f6 160000 --- a/libs/hbb_common +++ b/libs/hbb_common @@ -1 +1 @@ -Subproject commit 98d256d1b92c17f076c03254195783491ed94b05 +Subproject commit 4867575f65ee98e7f70169a06ca2cfe10d0f8330 diff --git a/src/client/io_loop.rs b/src/client/io_loop.rs index 7d892648e..34c462f4d 100644 --- a/src/client/io_loop.rs +++ b/src/client/io_loop.rs @@ -204,11 +204,6 @@ impl Remote { tokio::time::sleep(KCP_CLOSE_REASON_FLUSH_DELAY).await; } self.handle_disconnected(round); - // Close the WebRTC pc on this decline path too (no-op for TCP/WS); otherwise its - // pc lingers in the global session cache until ICE decays on its own. The pc - // and its teardown live on hbb_common's WebRTC I/O runtime, so this session - // runtime's death on return affects neither. - peer.close_webrtc(); return; } self.handler.update_direct(Some(direct)); @@ -355,14 +350,6 @@ impl Remote { } } log::debug!("Exit io_loop of id={}", self.handler.get_id()); - // Close the WebRTC peer connection (if this session used it) so its pc is not left - // lingering in the global session cache after the session ends; dropping `peer` - // alone does not release it. No-op for TCP/WebSocket transports. The pc, its - // sockets and pump tasks, and this close all live on hbb_common's WebRTC I/O - // runtime — nothing may run them on this session runtime, which is dropped the - // moment io_loop returns and would kill the teardown (or, if awaited under a - // timeout, cancel it after `close()` latches `is_closed`, stranding the pc). - peer.close_webrtc(); // Stop client audio server. if let Some(s) = self.stop_voice_call_sender.take() { s.send(()).ok(); diff --git a/src/port_forward.rs b/src/port_forward.rs index 24cbea179..439f6380c 100644 --- a/src/port_forward.rs +++ b/src/port_forward.rs @@ -180,9 +180,6 @@ async fn connect_and_login( if !stream.is_secured() && !crate::common::is_direct_ip_access(id) { if !confirm_insecure_connection(&interface, ui_receiver).await { *close_port_forward = true; - // Close the WebRTC pc on this decline path too (no-op for TCP/WS), matching every - // other exit in this function; a bare drop leaks it in the global session cache. - stream.close_webrtc(); return Ok(None); } } @@ -197,7 +194,6 @@ async fn connect_and_login( tokio::select! { res = timeout(READ_TIMEOUT, stream.next()) => match res { Err(_) => { - stream.close_webrtc(); bail!("Timeout"); } Ok(Some(Ok(bytes))) => { @@ -208,7 +204,6 @@ async fn connect_and_login( let msg_in = match Message::parse_from_bytes(&bytes) { Ok(msg) => msg, Err(err) => { - stream.close_webrtc(); return Err(err.into()); } }; @@ -222,7 +217,6 @@ async fn connect_and_login( Some(message::Union::LoginResponse(lr)) => match lr.union { Some(login_response::Union::Error(err)) => { if !interface.handle_login_error(&err) { - stream.close_webrtc(); return Ok(None); } } @@ -239,11 +233,9 @@ async fn connect_and_login( } } Ok(Some(Err(err))) => { - stream.close_webrtc(); bail!("Connection closed: {}", err); } _ => { - stream.close_webrtc(); bail!("Reset by the peer"); } }, @@ -263,7 +255,6 @@ async fn connect_and_login( if let Some(Ok(bytes)) = res { buffer.extend(bytes); } else { - stream.close_webrtc(); return Ok(None); } }, @@ -594,7 +585,6 @@ async fn run_forward(forward: Framed, stream: Stream) -> }, } } - stream.close_webrtc(); Ok(()) }