Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(719)

Unified Diff: webrtc/api/peerconnection.cc

Issue 2566833002: Don't allow changing ICE pool size after SetLocalDescription. (Closed)
Patch Set: Fixing signed/unsigned compare warning. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/api/peerconnectioninterface_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/peerconnection.cc
diff --git a/webrtc/api/peerconnection.cc b/webrtc/api/peerconnection.cc
index a47b2f2d8c55831f0ab80d4699d446d4ed3b1954..d0cdb036597025cd9c609b3f28e1a1f9600c4410 100644
--- a/webrtc/api/peerconnection.cc
+++ b/webrtc/api/peerconnection.cc
@@ -1268,6 +1268,14 @@ PeerConnectionInterface::RTCConfiguration PeerConnection::GetConfiguration() {
bool PeerConnection::SetConfiguration(const RTCConfiguration& configuration) {
TRACE_EVENT0("webrtc", "PeerConnection::SetConfiguration");
+
+ if (session_->local_description() &&
+ configuration.ice_candidate_pool_size !=
+ configuration_.ice_candidate_pool_size) {
+ LOG(LS_ERROR) << "Can't change candidate pool size after calling "
+ "SetLocalDescription.";
+ return false;
+ }
// TODO(deadbeef): Return false and log an error if there are any unsupported
// modifications.
if (port_allocator_) {
@@ -1275,6 +1283,7 @@ bool PeerConnection::SetConfiguration(const RTCConfiguration& configuration) {
RTC_FROM_HERE,
rtc::Bind(&PeerConnection::ReconfigurePortAllocator_n, this,
configuration))) {
+ LOG(LS_ERROR) << "Failed to apply configuration to PortAllocator.";
return false;
}
}
@@ -2359,10 +2368,9 @@ bool PeerConnection::ReconfigurePortAllocator_n(
ConvertIceTransportTypeToCandidateFilter(configuration.type));
// Call this last since it may create pooled allocator sessions using the
// candidate filter set above.
- port_allocator_->SetConfiguration(stun_servers, turn_servers,
- configuration.ice_candidate_pool_size,
- configuration.prune_turn_ports);
- return true;
+ return port_allocator_->SetConfiguration(
+ stun_servers, turn_servers, configuration.ice_candidate_pool_size,
+ configuration.prune_turn_ports);
}
bool PeerConnection::StartRtcEventLog_w(rtc::PlatformFile file,
« no previous file with comments | « no previous file | webrtc/api/peerconnectioninterface_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698