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

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

Issue 439153004: Using hostname for TLS setup when IP address is not available. This usually (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
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 | no next file » | 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 ce99a1ff04f596e8b616c1463c8458fd1ac414e6..a5aac2f0808012a28f0f316f81c7526d56c3f806 100644
--- a/content/browser/renderer_host/p2p/socket_host_tcp.cc
+++ b/content/browser/renderer_host/p2p/socket_host_tcp.cc
@@ -185,10 +185,17 @@ void P2PSocketHostTcpBase::StartTls() {
// Default ssl config.
const net::SSLConfig ssl_config;
- net::HostPortPair 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);
+ 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);
+ } 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);
+ }
net::ClientSocketFactory* socket_factory =
net::ClientSocketFactory::GetDefaultFactory();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698