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

Unified Diff: content/browser/renderer_host/p2p/socket_host_tcp.cc

Issue 787003004: Hide the proxy socket address from the clients of ProxyResolvingClientSocket. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 | « no previous file | content/renderer/p2p/ipc_socket_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
« no previous file with comments | « no previous file | content/renderer/p2p/ipc_socket_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698