(Auto)update libjingle 65152644-> 65219629
git-svn-id: http://webrtc.googlecode.com/svn/trunk@5941 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
@@ -442,16 +442,19 @@ void TurnPort::ResolveTurnAddress(const talk_base::SocketAddress& address) {
|
|||||||
|
|
||||||
void TurnPort::OnResolveResult(talk_base::AsyncResolverInterface* resolver) {
|
void TurnPort::OnResolveResult(talk_base::AsyncResolverInterface* resolver) {
|
||||||
ASSERT(resolver == resolver_);
|
ASSERT(resolver == resolver_);
|
||||||
|
talk_base::SocketAddress resolved_address;
|
||||||
if (resolver_->GetError() != 0 ||
|
if (resolver_->GetError() != 0 ||
|
||||||
!resolver_->GetResolvedAddress(ip().family(), &server_address_.address)) {
|
!resolver_->GetResolvedAddress(ip().family(), &resolved_address)) {
|
||||||
LOG_J(LS_WARNING, this) << "TURN host lookup received error "
|
LOG_J(LS_WARNING, this) << "TURN host lookup received error "
|
||||||
<< resolver_->GetError();
|
<< resolver_->GetError();
|
||||||
OnAllocateError();
|
OnAllocateError();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// Signal needs both resolved and unresolved address. After signal is sent
|
||||||
|
// we can copy resolved address back into |server_address_|.
|
||||||
SignalResolvedServerAddress(this, server_address_.address,
|
SignalResolvedServerAddress(this, server_address_.address,
|
||||||
resolver_->address());
|
resolved_address);
|
||||||
|
server_address_.address = resolved_address;
|
||||||
PrepareAddress();
|
PrepareAddress();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1083,7 +1083,7 @@ void AllocationSequence::OnResolvedTurnServerAddress(
|
|||||||
iter = turn_ports_.find(server_address);
|
iter = turn_ports_.find(server_address);
|
||||||
|
|
||||||
ASSERT(iter != turn_ports_.end());
|
ASSERT(iter != turn_ports_.end());
|
||||||
ASSERT(iter->second != port);
|
ASSERT(iter->second == port);
|
||||||
// Remove old entry and then insert using the resolved address as key.
|
// Remove old entry and then insert using the resolved address as key.
|
||||||
turn_ports_.erase(iter);
|
turn_ports_.erase(iter);
|
||||||
turn_ports_[resolved_server_address] = port;
|
turn_ports_[resolved_server_address] = port;
|
||||||
|
@@ -739,6 +739,33 @@ TEST_F(PortAllocatorTest, TestSharedSocketWithoutNatUsingTurn) {
|
|||||||
EXPECT_EQ(3U, candidates_.size());
|
EXPECT_EQ(3U, candidates_.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Testing DNS resolve for the TURN server, this will test AllocationSequence
|
||||||
|
// handling the unresolved address signal from TurnPort.
|
||||||
|
TEST_F(PortAllocatorTest, TestSharedSocketWithServerAddressResolve) {
|
||||||
|
turn_server_.AddInternalSocket(talk_base::SocketAddress("127.0.0.1", 3478),
|
||||||
|
cricket::PROTO_UDP);
|
||||||
|
AddInterface(kClientAddr);
|
||||||
|
allocator_.reset(new cricket::BasicPortAllocator(&network_manager_));
|
||||||
|
cricket::RelayServerConfig relay_server(cricket::RELAY_TURN);
|
||||||
|
cricket::RelayCredentials credentials(kTurnUsername, kTurnPassword);
|
||||||
|
relay_server.credentials = credentials;
|
||||||
|
relay_server.ports.push_back(cricket::ProtocolAddress(
|
||||||
|
talk_base::SocketAddress("localhost", 3478),
|
||||||
|
cricket::PROTO_UDP, false));
|
||||||
|
allocator_->AddRelay(relay_server);
|
||||||
|
|
||||||
|
allocator_->set_step_delay(cricket::kMinimumStepDelay);
|
||||||
|
allocator_->set_flags(allocator().flags() |
|
||||||
|
cricket::PORTALLOCATOR_ENABLE_SHARED_UFRAG |
|
||||||
|
cricket::PORTALLOCATOR_ENABLE_SHARED_SOCKET |
|
||||||
|
cricket::PORTALLOCATOR_DISABLE_TCP);
|
||||||
|
|
||||||
|
EXPECT_TRUE(CreateSession(cricket::ICE_CANDIDATE_COMPONENT_RTP));
|
||||||
|
session_->StartGettingPorts();
|
||||||
|
|
||||||
|
EXPECT_EQ_WAIT(2U, ports_.size(), kDefaultAllocationTimeout);
|
||||||
|
}
|
||||||
|
|
||||||
// Test that when PORTALLOCATOR_ENABLE_SHARED_SOCKET is enabled only one port
|
// Test that when PORTALLOCATOR_ENABLE_SHARED_SOCKET is enabled only one port
|
||||||
// is allocated for udp/stun/turn. In this test we should expect all local,
|
// is allocated for udp/stun/turn. In this test we should expect all local,
|
||||||
// stun and turn candidates.
|
// stun and turn candidates.
|
||||||
|
Reference in New Issue
Block a user