| Index: webrtc/p2p/base/transportcontroller.cc
|
| diff --git a/webrtc/p2p/base/transportcontroller.cc b/webrtc/p2p/base/transportcontroller.cc
|
| index a961541dc3e9e4dd1ac2b1655d126f1b1eee7566..fcf46e5d9d5a5430e2972dfa9d3638ae5c5c4e82 100644
|
| --- a/webrtc/p2p/base/transportcontroller.cc
|
| +++ b/webrtc/p2p/base/transportcontroller.cc
|
| @@ -576,20 +576,17 @@ void TransportController::OnChannelCandidatesRemoved(
|
| void TransportController::OnChannelRoleConflict_n(
|
| TransportChannelImpl* channel) {
|
| RTC_DCHECK(network_thread_->IsCurrent());
|
| -
|
| - if (ice_role_switch_) {
|
| - LOG(LS_WARNING)
|
| - << "Repeat of role conflict signal from TransportChannelImpl.";
|
| - return;
|
| - }
|
| -
|
| - ice_role_switch_ = true;
|
| + // Note: since the role conflict is handled entirely on the network thread,
|
| + // we don't need to worry about role conflicts occurring on two ports at once.
|
| + // The first one encountered should immediately reverse the role.
|
| IceRole reversed_role = (ice_role_ == ICEROLE_CONTROLLING)
|
| ? ICEROLE_CONTROLLED
|
| : ICEROLE_CONTROLLING;
|
| - for (const auto& kv : transports_) {
|
| - kv.second->SetIceRole(reversed_role);
|
| - }
|
| + LOG(LS_INFO) << "Got role conflict; switching to "
|
| + << (reversed_role == ICEROLE_CONTROLLING ? "controlling"
|
| + : "controlled")
|
| + << " role.";
|
| + SetIceRole_n(reversed_role);
|
| }
|
|
|
| void TransportController::OnChannelConnectionRemoved_n(
|
|
|