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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 // Updating the remote ICE candidate generation could change the sort order. | 344 // Updating the remote ICE candidate generation could change the sort order. |
345 RequestSortAndStateUpdate(); | 345 RequestSortAndStateUpdate(); |
346 } | 346 } |
347 | 347 |
348 void P2PTransportChannel::SetRemoteIceMode(IceMode mode) { | 348 void P2PTransportChannel::SetRemoteIceMode(IceMode mode) { |
349 remote_ice_mode_ = mode; | 349 remote_ice_mode_ = mode; |
350 } | 350 } |
351 | 351 |
352 void P2PTransportChannel::SetIceConfig(const IceConfig& config) { | 352 void P2PTransportChannel::SetIceConfig(const IceConfig& config) { |
353 if (config_.continual_gathering_policy != config.continual_gathering_policy) { | 353 if (config_.continual_gathering_policy != config.continual_gathering_policy) { |
354 config_.continual_gathering_policy = config.continual_gathering_policy; | 354 if (!allocator_sessions_.empty()) { |
355 LOG(LS_INFO) << "Set continual_gathering_policy to " | 355 LOG(LS_ERROR) << "Trying to change continual gathering policy " |
356 << config_.continual_gathering_policy; | 356 << "when gathering has already started!"; |
| 357 } else { |
| 358 config_.continual_gathering_policy = config.continual_gathering_policy; |
| 359 LOG(LS_INFO) << "Set continual_gathering_policy to " |
| 360 << config_.continual_gathering_policy; |
| 361 } |
357 } | 362 } |
358 | 363 |
359 if (config.backup_connection_ping_interval >= 0 && | 364 if (config.backup_connection_ping_interval >= 0 && |
360 config_.backup_connection_ping_interval != | 365 config_.backup_connection_ping_interval != |
361 config.backup_connection_ping_interval) { | 366 config.backup_connection_ping_interval) { |
362 config_.backup_connection_ping_interval = | 367 config_.backup_connection_ping_interval = |
363 config.backup_connection_ping_interval; | 368 config.backup_connection_ping_interval; |
364 LOG(LS_INFO) << "Set backup connection ping interval to " | 369 LOG(LS_INFO) << "Set backup connection ping interval to " |
365 << config_.backup_connection_ping_interval << " milliseconds."; | 370 << config_.backup_connection_ping_interval << " milliseconds."; |
366 } | 371 } |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 const std::vector<Candidate>& candidates) { | 522 const std::vector<Candidate>& candidates) { |
518 ASSERT(worker_thread_ == rtc::Thread::Current()); | 523 ASSERT(worker_thread_ == rtc::Thread::Current()); |
519 for (size_t i = 0; i < candidates.size(); ++i) { | 524 for (size_t i = 0; i < candidates.size(); ++i) { |
520 SignalCandidateGathered(this, candidates[i]); | 525 SignalCandidateGathered(this, candidates[i]); |
521 } | 526 } |
522 } | 527 } |
523 | 528 |
524 void P2PTransportChannel::OnCandidatesAllocationDone( | 529 void P2PTransportChannel::OnCandidatesAllocationDone( |
525 PortAllocatorSession* session) { | 530 PortAllocatorSession* session) { |
526 ASSERT(worker_thread_ == rtc::Thread::Current()); | 531 ASSERT(worker_thread_ == rtc::Thread::Current()); |
| 532 if (config_.gather_continually()) { |
| 533 LOG(LS_INFO) << "P2PTransportChannel: " << transport_name() |
| 534 << ", component " << component() |
| 535 << " gathering complete, but using continual " |
| 536 << "gathering so not changing gathering state."; |
| 537 return; |
| 538 } |
527 gathering_state_ = kIceGatheringComplete; | 539 gathering_state_ = kIceGatheringComplete; |
528 LOG(LS_INFO) << "P2PTransportChannel: " << transport_name() << ", component " | 540 LOG(LS_INFO) << "P2PTransportChannel: " << transport_name() << ", component " |
529 << component() << " gathering complete"; | 541 << component() << " gathering complete"; |
530 SignalGatheringState(this); | 542 SignalGatheringState(this); |
531 } | 543 } |
532 | 544 |
533 // Handle stun packets | 545 // Handle stun packets |
534 void P2PTransportChannel::OnUnknownAddress( | 546 void P2PTransportChannel::OnUnknownAddress( |
535 PortInterface* port, | 547 PortInterface* port, |
536 const rtc::SocketAddress& address, ProtocolType proto, | 548 const rtc::SocketAddress& address, ProtocolType proto, |
(...skipping 1407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1944 | 1956 |
1945 // During the initial state when nothing has been pinged yet, return the first | 1957 // During the initial state when nothing has been pinged yet, return the first |
1946 // one in the ordered |connections_|. | 1958 // one in the ordered |connections_|. |
1947 return *(std::find_if(connections_.begin(), connections_.end(), | 1959 return *(std::find_if(connections_.begin(), connections_.end(), |
1948 [conn1, conn2](Connection* conn) { | 1960 [conn1, conn2](Connection* conn) { |
1949 return conn == conn1 || conn == conn2; | 1961 return conn == conn1 || conn == conn2; |
1950 })); | 1962 })); |
1951 } | 1963 } |
1952 | 1964 |
1953 } // namespace cricket | 1965 } // namespace cricket |
OLD | NEW |