Index: content/browser/renderer_host/p2p/socket_host_tcp.cc |
diff --git a/content/browser/renderer_host/p2p/socket_host_tcp.cc b/content/browser/renderer_host/p2p/socket_host_tcp.cc |
index 79f7b14b0b867e34c784a483c24851c9199ea6f8..b5a927699a3c8687dc9eb39c3f712fd4c6b51b7a 100644 |
--- a/content/browser/renderer_host/p2p/socket_host_tcp.cc |
+++ b/content/browser/renderer_host/p2p/socket_host_tcp.cc |
@@ -256,6 +256,8 @@ bool P2PSocketHostTcpBase::DoSendSocketCreateMsg() { |
VLOG(1) << "Local address: " << local_address.ToString(); |
net::IPEndPoint remote_address; |
+ |
+ // |remote_address| could be empty if it is connected through a proxy. |
result = socket_->GetPeerAddress(&remote_address); |
if (result < 0) { |
LOG(ERROR) << "P2PSocketHostTcpBase::OnConnected: unable to get peer" |
@@ -264,14 +266,15 @@ bool P2PSocketHostTcpBase::DoSendSocketCreateMsg() { |
return false; |
} |
VLOG(1) << "Remote address: " << remote_address.ToString(); |
- if (remote_address_.ip_address.address().empty()) { |
+ if (remote_address_.ip_address.address().empty() && |
+ !remote_address.address().empty()) { |
// Save |remote_address| if address is empty. |
remote_address_.ip_address = remote_address; |
} |
// If we are not doing TLS, we are ready to send data now. |
// In case of TLS SignalConnect will be sent only after TLS handshake is |
- // successfull. So no buffering will be done at socket handlers if any |
+ // successful. So no buffering will be done at socket handlers if any |
// packets sent before that by the application. |
message_sender_->Send(new P2PMsg_OnSocketCreated( |
id_, local_address, remote_address)); |