From e98dd3e2922c111a3eaa5c47f0e4350e1cca676f Mon Sep 17 00:00:00 2001 From: xicilion Date: Sat, 11 May 2024 03:33:55 +0800 Subject: [PATCH] Disable comparing local and remote iceUfrag and icePwd in validateRemoteDescription. --- src/impl/peerconnection.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/impl/peerconnection.cpp b/src/impl/peerconnection.cpp index 3133fe328..d6bcdb1e1 100644 --- a/src/impl/peerconnection.cpp +++ b/src/impl/peerconnection.cpp @@ -858,10 +858,11 @@ void PeerConnection::validateRemoteDescription(const Description &description) { if (activeMediaCount == 0) throw std::invalid_argument("Remote description has no active media"); - if (auto local = localDescription(); local && local->iceUfrag() && local->icePwd()) - if (*description.iceUfrag() == *local->iceUfrag() && - *description.icePwd() == *local->icePwd()) - throw std::logic_error("Got the local description as remote description"); + // In the WebRTC Direct protocol, we need to allow local and remote to use the same ufrag and pwd. + // if (auto local = localDescription(); local && local->iceUfrag() && local->icePwd()) + // if (*description.iceUfrag() == *local->iceUfrag() && + // *description.icePwd() == *local->icePwd()) + // throw std::logic_error("Got the local description as remote description"); PLOG_VERBOSE << "Remote description looks valid"; }