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

Unified 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, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/p2p/base/portallocator.h ('k') | webrtc/p2p/client/portallocator_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/p2p/client/basicportallocator.cc
diff --git a/webrtc/p2p/client/basicportallocator.cc b/webrtc/p2p/client/basicportallocator.cc
index 2a9ee3b8ba063cdb987dc25cf89c680a6b67280e..982025279d7322102add345e7c897145599233bb 100644
--- a/webrtc/p2p/client/basicportallocator.cc
+++ b/webrtc/p2p/client/basicportallocator.cc
@@ -983,6 +983,13 @@ void AllocationSequence::CreateTurnPort(const RelayServerConfig& config) {
for (relay_port = config.ports.begin();
relay_port != config.ports.end(); ++relay_port) {
TurnPort* port = NULL;
+
+ // Skip UDP connections to relay servers if it's disallowed.
+ if (IsFlagSet(PORTALLOCATOR_DISABLE_UDP_RELAY) &&
+ relay_port->proto == PROTO_UDP) {
+ continue;
+ }
+
// Shared socket mode must be enabled only for UDP based ports. Hence
// don't pass shared socket for ports which will create TCP sockets.
// TODO(mallinath) - Enable shared socket mode for TURN ports. Disabled
« no previous file with comments | « webrtc/p2p/base/portallocator.h ('k') | webrtc/p2p/client/portallocator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698