From a70be68f651a75930681b7607fd4da054de68842 Mon Sep 17 00:00:00 2001 From: "mallinath@webrtc.org" Date: Mon, 7 Jul 2014 20:47:24 +0000 Subject: [PATCH] Disabling shared socket mode for TURN ports. This is done as currently when TURN server also used as STUN server, binding responses will be handed over to TURN port, which simply discard these messages, as requests are originated from StunPort. Until we find the right solution for this problem, it's better we disable this feature. BUG=https://code.google.com/p/webrtc/issues/detail?id=3537 R=jiayl@webrtc.org, juberti@webrtc.org Review URL: https://webrtc-codereview.appspot.com/19889004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@6618 4adac7df-926f-26a2-2b94-8c16560cd09d --- talk/p2p/base/portallocator.h | 1 + talk/p2p/client/basicportallocator.cc | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/talk/p2p/base/portallocator.h b/talk/p2p/base/portallocator.h index e2cb3fd20..ade9c7a04 100644 --- a/talk/p2p/base/portallocator.h +++ b/talk/p2p/base/portallocator.h @@ -54,6 +54,7 @@ const uint32 PORTALLOCATOR_ENABLE_IPV6 = 0x40; const uint32 PORTALLOCATOR_ENABLE_SHARED_UFRAG = 0x80; const uint32 PORTALLOCATOR_ENABLE_SHARED_SOCKET = 0x100; const uint32 PORTALLOCATOR_ENABLE_STUN_RETRANSMIT_ATTRIBUTE = 0x200; +const uint32 PORTALLOCATOR_ENABLE_TURN_SHARED_SOCKET = 0x400; const uint32 kDefaultPortAllocatorFlags = 0; diff --git a/talk/p2p/client/basicportallocator.cc b/talk/p2p/client/basicportallocator.cc index 5c3e387ab..696588a51 100644 --- a/talk/p2p/client/basicportallocator.cc +++ b/talk/p2p/client/basicportallocator.cc @@ -1018,7 +1018,9 @@ void AllocationSequence::CreateTurnPort(const RelayServerConfig& config) { TurnPort* port = NULL; // Shared socket mode must be enabled only for UDP based ports. Hence // don't pass shared socket for ports which will create TCP sockets. - if (IsFlagSet(PORTALLOCATOR_ENABLE_SHARED_SOCKET) && + // TODO(mallinath) - Enable shared socket mode for TURN ports. Disabled + // due to webrtc bug https://code.google.com/p/webrtc/issues/detail?id=3537 + if (IsFlagSet(PORTALLOCATOR_ENABLE_TURN_SHARED_SOCKET) && relay_port->proto == PROTO_UDP) { port = TurnPort::Create(session_->network_thread(), session_->socket_factory(),