(Auto)update libjingle 65469804-> 65484212

git-svn-id: http://webrtc.googlecode.com/svn/trunk@5967 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
buildbot@webrtc.org
2014-04-24 00:00:12 +00:00
parent 0d915ff603
commit 3f1aa24078
2 changed files with 26 additions and 4 deletions

View File

@@ -237,7 +237,7 @@ TCPConnection::TCPConnection(TCPPort* port, const Candidate& candidate,
int opts = (candidate.protocol() == SSLTCP_PROTOCOL_NAME) ?
talk_base::PacketSocketFactory::OPT_SSLTCP : 0;
socket_ = port->socket_factory()->CreateClientTcpSocket(
talk_base::SocketAddress(port_->Network()->ip(), 0),
talk_base::SocketAddress(port->ip(), 0),
candidate.address(), port->proxy(), port->user_agent(), opts);
if (socket_) {
LOG_J(LS_VERBOSE, this) << "Connecting from "
@@ -293,9 +293,19 @@ int TCPConnection::GetError() {
void TCPConnection::OnConnect(talk_base::AsyncPacketSocket* socket) {
ASSERT(socket == socket_);
LOG_J(LS_VERBOSE, this) << "Connection established to "
<< socket->GetRemoteAddress().ToSensitiveString();
set_connected(true);
// Do not use this connection if the socket bound to a different address than
// the one we asked for. This is seen in Chrome, where TCP sockets cannot be
// given a binding address, and the platform is expected to pick the
// correct local address.
if (socket->GetLocalAddress().ipaddr() == port()->ip()) {
LOG_J(LS_VERBOSE, this) << "Connection established to "
<< socket->GetRemoteAddress().ToSensitiveString();
set_connected(true);
} else {
LOG_J(LS_WARNING, this) << "Dropping connection as TCP socket bound to a "
<< "different address from the local candidate.";
socket_->Close();
}
}
void TCPConnection::OnClose(talk_base::AsyncPacketSocket* socket, int error) {

View File

@@ -297,6 +297,18 @@ void TurnPort::PrepareAddress() {
}
void TurnPort::OnSocketConnect(talk_base::AsyncPacketSocket* socket) {
ASSERT(server_address_.proto == PROTO_TCP);
// Do not use this port if the socket bound to a different address than
// the one we asked for. This is seen in Chrome, where TCP sockets cannot be
// given a binding address, and the platform is expected to pick the
// correct local address.
if (socket->GetLocalAddress().ipaddr() != ip()) {
LOG(LS_WARNING) << "Socket is bound to a different address then the "
<< "local port. Discarding TURN port.";
OnAllocateError();
return;
}
LOG(LS_INFO) << "TurnPort connected to " << socket->GetRemoteAddress()
<< " using tcp.";
SendRequest(new TurnAllocateRequest(this), 0);