From e1ea9e64dc46a4914c7e2a240a15e1c91a0890b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?The=CC=81o=20Monnom?= Date: Wed, 6 Sep 2023 16:39:02 -0700 Subject: [PATCH] Update rtc_session.rs --- livekit/src/rtc_engine/rtc_session.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/livekit/src/rtc_engine/rtc_session.rs b/livekit/src/rtc_engine/rtc_session.rs index c6fb10b6..1cb57d2b 100644 --- a/livekit/src/rtc_engine/rtc_session.rs +++ b/livekit/src/rtc_engine/rtc_session.rs @@ -866,10 +866,9 @@ impl SessionInner { self: &Arc, kind: DataPacketKind, ) -> EngineResult<()> { - if !self.publisher_pc.is_connected() - && self.publisher_pc.peer_connection().ice_connection_state() - != IceConnectionState::Checking - { + if !self.has_published.load(Ordering::Acquire) { + // The publisher has never been connected, start the negotiation + // If the connection fails, the reconnection logic will be triggered self.publisher_negotiation_needed(); }