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

Side by Side Diff: webrtc/p2p/client/basicportallocator.cc

Issue 1311153003: Add check to prevent TURN usage if the protocol is not allowed. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Created 5 years, 3 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
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 965 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 the turn server that uses disallowed protocol.
pthatcher1 2015/08/25 22:59:30 Might be more clear as "Skip UDP connections to re
988 if (IsFlagSet(PORTALLOCATOR_DISABLE_TURN_OVER_UDP) &&
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
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
OLDNEW
« webrtc/p2p/base/portallocator.h ('K') | « webrtc/p2p/base/portallocator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698