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 1332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1343 } | 1343 } |
1344 | 1344 |
1345 void AllocationSequence::CreateRelayPorts() { | 1345 void AllocationSequence::CreateRelayPorts() { |
1346 if (IsFlagSet(PORTALLOCATOR_DISABLE_RELAY)) { | 1346 if (IsFlagSet(PORTALLOCATOR_DISABLE_RELAY)) { |
1347 LOG(LS_VERBOSE) << "AllocationSequence: Relay ports disabled, skipping."; | 1347 LOG(LS_VERBOSE) << "AllocationSequence: Relay ports disabled, skipping."; |
1348 return; | 1348 return; |
1349 } | 1349 } |
1350 | 1350 |
1351 // If BasicPortAllocatorSession::OnAllocate left relay ports enabled then we | 1351 // If BasicPortAllocatorSession::OnAllocate left relay ports enabled then we |
1352 // ought to have a relay list for them here. | 1352 // ought to have a relay list for them here. |
1353 RTC_DCHECK(config_ && !config_->relays.empty()); | 1353 RTC_DCHECK(config_); |
| 1354 RTC_DCHECK(!config_->relays.empty()); |
1354 if (!(config_ && !config_->relays.empty())) { | 1355 if (!(config_ && !config_->relays.empty())) { |
1355 LOG(LS_WARNING) | 1356 LOG(LS_WARNING) |
1356 << "AllocationSequence: No relay server configured, skipping."; | 1357 << "AllocationSequence: No relay server configured, skipping."; |
1357 return; | 1358 return; |
1358 } | 1359 } |
1359 | 1360 |
1360 for (RelayServerConfig& relay : config_->relays) { | 1361 for (RelayServerConfig& relay : config_->relays) { |
1361 if (relay.type == RELAY_GTURN) { | 1362 if (relay.type == RELAY_GTURN) { |
1362 CreateGturnPort(relay); | 1363 CreateGturnPort(relay); |
1363 } else if (relay.type == RELAY_TURN) { | 1364 } else if (relay.type == RELAY_TURN) { |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1570 ServerAddresses servers; | 1571 ServerAddresses servers; |
1571 for (size_t i = 0; i < relays.size(); ++i) { | 1572 for (size_t i = 0; i < relays.size(); ++i) { |
1572 if (relays[i].type == turn_type && SupportsProtocol(relays[i], type)) { | 1573 if (relays[i].type == turn_type && SupportsProtocol(relays[i], type)) { |
1573 servers.insert(relays[i].ports.front().address); | 1574 servers.insert(relays[i].ports.front().address); |
1574 } | 1575 } |
1575 } | 1576 } |
1576 return servers; | 1577 return servers; |
1577 } | 1578 } |
1578 | 1579 |
1579 } // namespace cricket | 1580 } // namespace cricket |
OLD | NEW |