Index: webrtc/p2p/client/basicportallocator.cc |
diff --git a/webrtc/p2p/client/basicportallocator.cc b/webrtc/p2p/client/basicportallocator.cc |
index 21c8921f4024c51b3679471595a97dae199c1625..5d3397bf9166be5dca86bf9741e1a740865caeef 100644 |
--- a/webrtc/p2p/client/basicportallocator.cc |
+++ b/webrtc/p2p/client/basicportallocator.cc |
@@ -104,15 +104,19 @@ BasicPortAllocator::BasicPortAllocator( |
stun_servers_(stun_servers) { |
RelayServerConfig config(RELAY_GTURN); |
- if (!relay_address_udp.IsNil()) |
+ if (!relay_address_udp.IsNil()) { |
config.ports.push_back(ProtocolAddress(relay_address_udp, PROTO_UDP)); |
- if (!relay_address_tcp.IsNil()) |
+ } |
+ if (!relay_address_tcp.IsNil()) { |
config.ports.push_back(ProtocolAddress(relay_address_tcp, PROTO_TCP)); |
- if (!relay_address_ssl.IsNil()) |
+ } |
+ if (!relay_address_ssl.IsNil()) { |
config.ports.push_back(ProtocolAddress(relay_address_ssl, PROTO_SSLTCP)); |
+ } |
- if (!config.ports.empty()) |
- AddRelay(config); |
+ if (!config.ports.empty()) { |
+ AddTurnServer(config); |
+ } |
Construct(); |
} |
@@ -241,8 +245,8 @@ void BasicPortAllocatorSession::GetPortConfigurations() { |
username(), |
password()); |
- for (size_t i = 0; i < allocator_->relays().size(); ++i) { |
- config->AddRelay(allocator_->relays()[i]); |
+ for (const RelayServerConfig& turn_server : allocator_->turn_servers()) { |
+ config->AddRelay(turn_server); |
} |
ConfigReady(config); |
} |
@@ -253,8 +257,9 @@ void BasicPortAllocatorSession::ConfigReady(PortConfiguration* config) { |
// Adds a configuration to the list. |
void BasicPortAllocatorSession::OnConfigReady(PortConfiguration* config) { |
- if (config) |
+ if (config) { |
configs_.push_back(config); |
+ } |
AllocatePorts(); |
} |