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 14 matching lines...) Expand all Loading... |
25 ice_ufrag_(ice_ufrag), | 25 ice_ufrag_(ice_ufrag), |
26 ice_pwd_(ice_pwd) { | 26 ice_pwd_(ice_pwd) { |
27 // Pooled sessions are allowed to be created with empty content name, | 27 // Pooled sessions are allowed to be created with empty content name, |
28 // component, ufrag and password. | 28 // component, ufrag and password. |
29 RTC_DCHECK(ice_ufrag.empty() == ice_pwd.empty()); | 29 RTC_DCHECK(ice_ufrag.empty() == ice_pwd.empty()); |
30 } | 30 } |
31 | 31 |
32 void PortAllocator::SetConfiguration( | 32 void PortAllocator::SetConfiguration( |
33 const ServerAddresses& stun_servers, | 33 const ServerAddresses& stun_servers, |
34 const std::vector<RelayServerConfig>& turn_servers, | 34 const std::vector<RelayServerConfig>& turn_servers, |
35 int candidate_pool_size, | 35 int candidate_pool_size) { |
36 bool prune_turn_ports) { | |
37 bool ice_servers_changed = | 36 bool ice_servers_changed = |
38 (stun_servers != stun_servers_ || turn_servers != turn_servers_); | 37 (stun_servers != stun_servers_ || turn_servers != turn_servers_); |
39 stun_servers_ = stun_servers; | 38 stun_servers_ = stun_servers; |
40 turn_servers_ = turn_servers; | 39 turn_servers_ = turn_servers; |
41 prune_turn_ports_ = prune_turn_ports; | |
42 | 40 |
43 // If ICE servers changed, throw away any existing pooled sessions and create | 41 // If ICE servers changed, throw away any existing pooled sessions and create |
44 // new ones. | 42 // new ones. |
45 if (ice_servers_changed) { | 43 if (ice_servers_changed) { |
46 pooled_sessions_.clear(); | 44 pooled_sessions_.clear(); |
47 allocated_pooled_session_count_ = 0; | 45 allocated_pooled_session_count_ = 0; |
48 } | 46 } |
49 | 47 |
50 // If |size| is less than the number of allocated sessions, get rid of the | 48 // If |size| is less than the number of allocated sessions, get rid of the |
51 // extras. | 49 // extras. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 } | 98 } |
101 | 99 |
102 const PortAllocatorSession* PortAllocator::GetPooledSession() const { | 100 const PortAllocatorSession* PortAllocator::GetPooledSession() const { |
103 if (pooled_sessions_.empty()) { | 101 if (pooled_sessions_.empty()) { |
104 return nullptr; | 102 return nullptr; |
105 } | 103 } |
106 return pooled_sessions_.front().get(); | 104 return pooled_sessions_.front().get(); |
107 } | 105 } |
108 | 106 |
109 } // namespace cricket | 107 } // namespace cricket |
OLD | NEW |