Browse Source

Fixed ICE remote description rejection

Paul-Louis Ageneau 2 years ago
parent
commit
ff0fae14f4
2 changed files with 7 additions and 7 deletions
  1. 0 6
      src/impl/peerconnection.cpp
  2. 7 1
      src/peerconnection.cpp

+ 0 - 6
src/impl/peerconnection.cpp

@@ -1010,12 +1010,6 @@ void PeerConnection::processRemoteDescription(Description description) {
 		mRemoteDescription->addCandidates(std::move(existingCandidates));
 	}
 
-	auto iceTransport = initIceTransport();
-	if (!iceTransport)
-		return; // closed
-
-	iceTransport->setRemoteDescription(std::move(description));
-
 	if (description.hasApplication()) {
 		auto dtlsTransport = std::atomic_load(&mDtlsTransport);
 		auto sctpTransport = std::atomic_load(&mSctpTransport);

+ 7 - 1
src/peerconnection.cpp

@@ -218,8 +218,14 @@ void PeerConnection::setRemoteDescription(Description description) {
 	// Candidates will be added at the end, extract them for now
 	auto remoteCandidates = description.extractCandidates();
 	auto type = description.type();
-	impl()->processRemoteDescription(std::move(description));
 
+	auto iceTransport = impl()->initIceTransport();
+	if (!iceTransport)
+		return; // closed
+
+	iceTransport->setRemoteDescription(description); // ICE transport might reject the description
+
+	impl()->processRemoteDescription(std::move(description));
 	impl()->changeSignalingState(newSignalingState);
 	signalingLock.unlock();