Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Side by Side Diff: webrtc/p2p/base/portallocator.cc

Issue 2093623004: Add config to prune TURN ports (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Partially disable the test TestEachInterfaceHasItsOwnTurnPorts Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/p2p/base/portallocator.h ('k') | webrtc/p2p/base/portallocator_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « webrtc/p2p/base/portallocator.h ('k') | webrtc/p2p/base/portallocator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698