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

Unified Diff: content/browser/renderer_host/p2p/socket_host_tcp.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 | « 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 2955b6182d4dce49242c2ce920b34a7ce0c1c9c3..1ee1627b5d72d9f1175415c1db67b61052b5aa25 100644
--- a/content/browser/renderer_host/p2p/socket_host_tcp.cc
+++ b/content/browser/renderer_host/p2p/socket_host_tcp.cc
@@ -186,16 +186,16 @@ void P2PSocketHostTcpBase::StartTls() {
// Default ssl config.
const net::SSLConfig ssl_config;
net::HostPortPair dest_host_port_pair;
- if (remote_address_.ip_address.address().empty()) {
- DCHECK(!remote_address_.hostname.empty());
- dest_host_port_pair = net::HostPortPair::FromString(
- remote_address_.hostname);
+
+ // Calling net::HostPortPair::FromIPEndPoint will crash if the IP address is
+ // empty.
+ if (!remote_address_.ip_address.address().empty()) {
+ net::HostPortPair::FromIPEndPoint(remote_address_.ip_address);
} else {
- dest_host_port_pair = net::HostPortPair::FromIPEndPoint(
- remote_address_.ip_address);
- if (!remote_address_.hostname.empty())
- dest_host_port_pair.set_host(remote_address_.hostname);
+ dest_host_port_pair.set_port(remote_address_.ip_address.port());
}
+ if (!remote_address_.hostname.empty())
+ dest_host_port_pair.set_host(remote_address_.hostname);
net::ClientSocketFactory* socket_factory =
net::ClientSocketFactory::GetDefaultFactory();
« 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