OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
302 // Updating the remote ICE candidate generation could change the sort order. | 302 // Updating the remote ICE candidate generation could change the sort order. |
303 RequestSortAndStateUpdate(); | 303 RequestSortAndStateUpdate(); |
304 } | 304 } |
305 | 305 |
306 void P2PTransportChannel::SetRemoteIceMode(IceMode mode) { | 306 void P2PTransportChannel::SetRemoteIceMode(IceMode mode) { |
307 remote_ice_mode_ = mode; | 307 remote_ice_mode_ = mode; |
308 } | 308 } |
309 | 309 |
310 void P2PTransportChannel::SetIceConfig(const IceConfig& config) { | 310 void P2PTransportChannel::SetIceConfig(const IceConfig& config) { |
311 if (config_.continual_gathering_policy != config.continual_gathering_policy) { | 311 if (config_.continual_gathering_policy != config.continual_gathering_policy) { |
312 LOG(LS_INFO) << "Set continual_gathering_policy to " | 312 if (!allocator_sessions_.empty()) { |
Taylor Brandstetter
2016/07/07 17:52:37
This class assumes the continual gathering policy
honghaiz3
2016/07/21 04:10:59
If you set continual gathering policy after a sess
Taylor_Brandstetter
2016/07/21 16:41:01
This is the problem in my opinion. From an applica
honghaiz3
2016/07/21 17:37:25
In my opinion, the race condition is still there.
Taylor Brandstetter
2016/07/21 18:38:38
Sessions, including pooled sessions, are only adde
honghaiz3
2016/07/21 21:22:05
Can you please make a comment on the parameter con
pthatcher1
2016/07/22 18:11:22
While I agree consistent behavior is good, it woul
Taylor Brandstetter
2016/07/22 19:58:42
JSEP already says that SetConfiguration only chang
pthatcher1
2016/08/23 00:55:39
That's a good point about SetConfiguration only al
| |
313 << config_.continual_gathering_policy; | 313 LOG(LS_ERROR) << "Trying to change continual gathering policy " |
314 config_.continual_gathering_policy = config.continual_gathering_policy; | 314 << "when gathering has already started!"; |
315 } else { | |
316 LOG(LS_INFO) << "Set continual_gathering_policy to " | |
317 << config_.continual_gathering_policy; | |
318 config_.continual_gathering_policy = config.continual_gathering_policy; | |
319 } | |
315 } | 320 } |
316 | 321 |
317 if (config.backup_connection_ping_interval >= 0 && | 322 if (config.backup_connection_ping_interval >= 0 && |
318 config_.backup_connection_ping_interval != | 323 config_.backup_connection_ping_interval != |
319 config.backup_connection_ping_interval) { | 324 config.backup_connection_ping_interval) { |
320 config_.backup_connection_ping_interval = | 325 config_.backup_connection_ping_interval = |
321 config.backup_connection_ping_interval; | 326 config.backup_connection_ping_interval; |
322 LOG(LS_INFO) << "Set backup connection ping interval to " | 327 LOG(LS_INFO) << "Set backup connection ping interval to " |
323 << config_.backup_connection_ping_interval << " milliseconds."; | 328 << config_.backup_connection_ping_interval << " milliseconds."; |
324 } | 329 } |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
463 const std::vector<Candidate>& candidates) { | 468 const std::vector<Candidate>& candidates) { |
464 ASSERT(worker_thread_ == rtc::Thread::Current()); | 469 ASSERT(worker_thread_ == rtc::Thread::Current()); |
465 for (size_t i = 0; i < candidates.size(); ++i) { | 470 for (size_t i = 0; i < candidates.size(); ++i) { |
466 SignalCandidateGathered(this, candidates[i]); | 471 SignalCandidateGathered(this, candidates[i]); |
467 } | 472 } |
468 } | 473 } |
469 | 474 |
470 void P2PTransportChannel::OnCandidatesAllocationDone( | 475 void P2PTransportChannel::OnCandidatesAllocationDone( |
471 PortAllocatorSession* session) { | 476 PortAllocatorSession* session) { |
472 ASSERT(worker_thread_ == rtc::Thread::Current()); | 477 ASSERT(worker_thread_ == rtc::Thread::Current()); |
478 if (config_.gather_continually()) { | |
479 LOG(LS_INFO) << "P2PTransportChannel: " << transport_name() | |
480 << ", component " << component() | |
481 << " gathering complete, but using continual " | |
482 << "gathering so not changing gathering state."; | |
483 return; | |
484 } | |
473 gathering_state_ = kIceGatheringComplete; | 485 gathering_state_ = kIceGatheringComplete; |
474 LOG(LS_INFO) << "P2PTransportChannel: " << transport_name() << ", component " | 486 LOG(LS_INFO) << "P2PTransportChannel: " << transport_name() << ", component " |
475 << component() << " gathering complete"; | 487 << component() << " gathering complete"; |
476 SignalGatheringState(this); | 488 SignalGatheringState(this); |
477 } | 489 } |
478 | 490 |
479 // Handle stun packets | 491 // Handle stun packets |
480 void P2PTransportChannel::OnUnknownAddress( | 492 void P2PTransportChannel::OnUnknownAddress( |
481 PortInterface* port, | 493 PortInterface* port, |
482 const rtc::SocketAddress& address, ProtocolType proto, | 494 const rtc::SocketAddress& address, ProtocolType proto, |
(...skipping 1374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1857 | 1869 |
1858 // During the initial state when nothing has been pinged yet, return the first | 1870 // During the initial state when nothing has been pinged yet, return the first |
1859 // one in the ordered |connections_|. | 1871 // one in the ordered |connections_|. |
1860 return *(std::find_if(connections_.begin(), connections_.end(), | 1872 return *(std::find_if(connections_.begin(), connections_.end(), |
1861 [conn1, conn2](Connection* conn) { | 1873 [conn1, conn2](Connection* conn) { |
1862 return conn == conn1 || conn == conn2; | 1874 return conn == conn1 || conn == conn2; |
1863 })); | 1875 })); |
1864 } | 1876 } |
1865 | 1877 |
1866 } // namespace cricket | 1878 } // namespace cricket |
OLD | NEW |