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

Unified Diff: content/renderer/p2p/ipc_socket_factory.cc

Issue 466843002: Fix the hostname used to setup a TURN/TSL connection. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 months 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 | « content/browser/renderer_host/p2p/socket_host_tcp.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/p2p/ipc_socket_factory.cc
diff --git a/content/renderer/p2p/ipc_socket_factory.cc b/content/renderer/p2p/ipc_socket_factory.cc
index 62428ad0c2dbc1bad3fefd3ab2323dede34b03aa..9f04b7e89198f715739b136c41960f15372e4a07 100644
--- a/content/renderer/p2p/ipc_socket_factory.cc
+++ b/content/renderer/p2p/ipc_socket_factory.cc
@@ -235,18 +235,24 @@ bool IpcPacketSocket::Init(P2PSocketType type,
}
net::IPEndPoint remote_endpoint;
- if (!remote_address.IsNil() && !jingle_glue::SocketAddressToIPEndPoint(
- remote_address, &remote_endpoint) && !IsTcpClientSocket(type_)) {
+ if (!remote_address.IsNil() &&
Sergey Ulanov 2014/08/14 20:47:24 I suggest formatting this code as follows to make
jiayl 2014/08/14 22:31:47 That isn't the same logic. 1. The DCHECK is not t
jiayl 2014/08/15 00:05:33 I would rather just fix the hostname issue instead
Sergey Ulanov 2014/08/15 00:37:06 What are the cases when it's not true? remote_addr
Sergey Ulanov 2014/08/15 00:37:06 I don't think it changes logic if you take into ac
jiayl 2014/08/15 16:23:11 OK. That makes sense. done. On 2014/08/15 00:37:0
+ (remote_address.IsUnresolvedIP() ||
+ !jingle_glue::SocketAddressToIPEndPoint(remote_address,
+ &remote_endpoint)) &&
+ !IsTcpClientSocket(type_)) {
// Non TCP sockets must have a resolved remote address.
return false;
}
+ if (remote_address.IsUnresolvedIP()) {
+ remote_endpoint =
+ net::IPEndPoint(net::IPAddressNumber(), remote_address.port());
+ }
+
// We need to send both resolved and unresolved address in Init. Unresolved
// address will be used in case of TLS for certificate hostname matching.
// Certificate will be tied to domain name not to IP address.
- std::string remote_hostname = remote_address.hostname() + ":" +
- remote_address.PortAsString();
- P2PHostAndIPEndPoint remote_info(remote_hostname, remote_endpoint);
+ P2PHostAndIPEndPoint remote_info(remote_address.hostname(), remote_endpoint);
client->Init(type, local_endpoint, remote_info, this);
« no previous file with comments | « content/browser/renderer_host/p2p/socket_host_tcp.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698