| 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 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 976 // Start fetching an address for this port. | 976 // Start fetching an address for this port. |
| 977 port->PrepareAddress(); | 977 port->PrepareAddress(); |
| 978 } | 978 } |
| 979 } | 979 } |
| 980 | 980 |
| 981 void AllocationSequence::CreateTurnPort(const RelayServerConfig& config) { | 981 void AllocationSequence::CreateTurnPort(const RelayServerConfig& config) { |
| 982 PortList::const_iterator relay_port; | 982 PortList::const_iterator relay_port; |
| 983 for (relay_port = config.ports.begin(); | 983 for (relay_port = config.ports.begin(); |
| 984 relay_port != config.ports.end(); ++relay_port) { | 984 relay_port != config.ports.end(); ++relay_port) { |
| 985 TurnPort* port = NULL; | 985 TurnPort* port = NULL; |
| 986 |
| 987 // Skip UDP connections to relay servers if it's disallowed. |
| 988 if (IsFlagSet(PORTALLOCATOR_DISABLE_UDP_RELAY) && |
| 989 relay_port->proto == PROTO_UDP) { |
| 990 continue; |
| 991 } |
| 992 |
| 986 // Shared socket mode must be enabled only for UDP based ports. Hence | 993 // Shared socket mode must be enabled only for UDP based ports. Hence |
| 987 // don't pass shared socket for ports which will create TCP sockets. | 994 // don't pass shared socket for ports which will create TCP sockets. |
| 988 // TODO(mallinath) - Enable shared socket mode for TURN ports. Disabled | 995 // TODO(mallinath) - Enable shared socket mode for TURN ports. Disabled |
| 989 // due to webrtc bug https://code.google.com/p/webrtc/issues/detail?id=3537 | 996 // due to webrtc bug https://code.google.com/p/webrtc/issues/detail?id=3537 |
| 990 if (IsFlagSet(PORTALLOCATOR_ENABLE_SHARED_SOCKET) && | 997 if (IsFlagSet(PORTALLOCATOR_ENABLE_SHARED_SOCKET) && |
| 991 relay_port->proto == PROTO_UDP && udp_socket_) { | 998 relay_port->proto == PROTO_UDP && udp_socket_) { |
| 992 port = TurnPort::Create(session_->network_thread(), | 999 port = TurnPort::Create(session_->network_thread(), |
| 993 session_->socket_factory(), | 1000 session_->socket_factory(), |
| 994 network_, udp_socket_.get(), | 1001 network_, udp_socket_.get(), |
| 995 session_->username(), session_->password(), | 1002 session_->username(), session_->password(), |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1133 ServerAddresses servers; | 1140 ServerAddresses servers; |
| 1134 for (size_t i = 0; i < relays.size(); ++i) { | 1141 for (size_t i = 0; i < relays.size(); ++i) { |
| 1135 if (relays[i].type == turn_type && SupportsProtocol(relays[i], type)) { | 1142 if (relays[i].type == turn_type && SupportsProtocol(relays[i], type)) { |
| 1136 servers.insert(relays[i].ports.front().address); | 1143 servers.insert(relays[i].ports.front().address); |
| 1137 } | 1144 } |
| 1138 } | 1145 } |
| 1139 return servers; | 1146 return servers; |
| 1140 } | 1147 } |
| 1141 | 1148 |
| 1142 } // namespace cricket | 1149 } // namespace cricket |
| OLD | NEW |