From 27bc6e224696b1be26deca032578623ac34f72cb Mon Sep 17 00:00:00 2001 From: Tomas Gunnarsson Date: Fri, 12 Feb 2021 13:16:26 +0100 Subject: [PATCH] Reverting to previous behavior due to a downstream test expectation. This reverts the change in behavior for setRemoteDescription, introduced here: https://webrtc-review.googlesource.com/c/src/+/206063 And disables the associated test. Bug: webrtc:9987 Change-Id: I39a5664032a967a0a9cd336fa585d4d3880c88c5 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/207162 Reviewed-by: Harald Alvestrand Reviewed-by: Mirko Bonadei Commit-Queue: Tommi Cr-Commit-Position: refs/heads/master@{#33248} --- pc/peer_connection_ice_unittest.cc | 5 ++++- pc/sdp_offer_answer.cc | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/pc/peer_connection_ice_unittest.cc b/pc/peer_connection_ice_unittest.cc index f37943f8e4..6fabd51f3a 100644 --- a/pc/peer_connection_ice_unittest.cc +++ b/pc/peer_connection_ice_unittest.cc @@ -497,7 +497,10 @@ TEST_P(PeerConnectionIceTest, DuplicateIceCandidateIgnoredWhenAdded) { EXPECT_EQ(1u, caller->GetIceCandidatesFromRemoteDescription().size()); } -TEST_P(PeerConnectionIceTest, ErrorOnInvalidRemoteIceCandidateAdded) { +// TODO(tommi): Re-enable after updating RTCPeerConnection-blockedPorts.html in +// Chromium (the test needs setRemoteDescription to succeed for an invalid +// candidate). +TEST_P(PeerConnectionIceTest, DISABLED_ErrorOnInvalidRemoteIceCandidateAdded) { auto caller = CreatePeerConnectionWithAudioVideo(); auto callee = CreatePeerConnectionWithAudioVideo(); ASSERT_TRUE(callee->SetRemoteDescription(caller->CreateOfferAndSetAsLocal())); diff --git a/pc/sdp_offer_answer.cc b/pc/sdp_offer_answer.cc index b0a594b66a..4317bca132 100644 --- a/pc/sdp_offer_answer.cc +++ b/pc/sdp_offer_answer.cc @@ -4478,8 +4478,10 @@ bool SdpOfferAnswerHandler::UseCandidate( const cricket::Candidate& c = candidate->candidate(); RTCError error = cricket::VerifyCandidate(c); - if (!error.ok()) - return false; + if (!error.ok()) { + RTC_LOG(LS_WARNING) << "Invalid candidate: " << c.ToString(); + return true; + } pc_->AddRemoteCandidate(result.value()->name, c);