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) { |
36 bool ice_servers_changed = | 37 bool ice_servers_changed = |
37 (stun_servers != stun_servers_ || turn_servers != turn_servers_); | 38 (stun_servers != stun_servers_ || turn_servers != turn_servers_); |
38 stun_servers_ = stun_servers; | 39 stun_servers_ = stun_servers; |
39 turn_servers_ = turn_servers; | 40 turn_servers_ = turn_servers; |
| 41 prune_turn_ports_ = prune_turn_ports; |
40 | 42 |
41 // If ICE servers changed, throw away any existing pooled sessions and create | 43 // If ICE servers changed, throw away any existing pooled sessions and create |
42 // new ones. | 44 // new ones. |
43 if (ice_servers_changed) { | 45 if (ice_servers_changed) { |
44 pooled_sessions_.clear(); | 46 pooled_sessions_.clear(); |
45 allocated_pooled_session_count_ = 0; | 47 allocated_pooled_session_count_ = 0; |
46 } | 48 } |
47 | 49 |
48 // If |size| is less than the number of allocated sessions, get rid of the | 50 // If |size| is less than the number of allocated sessions, get rid of the |
49 // extras. | 51 // extras. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 } | 100 } |
99 | 101 |
100 const PortAllocatorSession* PortAllocator::GetPooledSession() const { | 102 const PortAllocatorSession* PortAllocator::GetPooledSession() const { |
101 if (pooled_sessions_.empty()) { | 103 if (pooled_sessions_.empty()) { |
102 return nullptr; | 104 return nullptr; |
103 } | 105 } |
104 return pooled_sessions_.front().get(); | 106 return pooled_sessions_.front().get(); |
105 } | 107 } |
106 | 108 |
107 } // namespace cricket | 109 } // namespace cricket |
OLD | NEW |