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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/p2p/ipc_socket_factory.h" 5 #include "content/renderer/p2p/ipc_socket_factory.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <deque> 8 #include <deque>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 return false; 234 return false;
235 } 235 }
236 236
237 net::IPEndPoint remote_endpoint; 237 net::IPEndPoint remote_endpoint;
238 if (!remote_address.IsNil() && !jingle_glue::SocketAddressToIPEndPoint( 238 if (!remote_address.IsNil() && !jingle_glue::SocketAddressToIPEndPoint(
239 remote_address, &remote_endpoint) && !IsTcpClientSocket(type_)) { 239 remote_address, &remote_endpoint) && !IsTcpClientSocket(type_)) {
240 // Non TCP sockets must have a resolved remote address. 240 // Non TCP sockets must have a resolved remote address.
241 return false; 241 return false;
242 } 242 }
243 243
244 if (remote_address.IsUnresolvedIP()) {
Sergey Ulanov 2014/08/14 17:55:09 In case when the anderss is unresolved do we reall
jiayl 2014/08/14 18:09:52 Done.
245 remote_endpoint =
246 net::IPEndPoint(net::IPAddressNumber(), remote_address.port());
247 }
248
244 // We need to send both resolved and unresolved address in Init. Unresolved 249 // We need to send both resolved and unresolved address in Init. Unresolved
245 // address will be used in case of TLS for certificate hostname matching. 250 // address will be used in case of TLS for certificate hostname matching.
246 // Certificate will be tied to domain name not to IP address. 251 // Certificate will be tied to domain name not to IP address.
247 std::string remote_hostname = remote_address.hostname() + ":" + 252 P2PHostAndIPEndPoint remote_info(remote_address.hostname(), remote_endpoint);
248 remote_address.PortAsString();
249 P2PHostAndIPEndPoint remote_info(remote_hostname, remote_endpoint);
250 253
251 client->Init(type, local_endpoint, remote_info, this); 254 client->Init(type, local_endpoint, remote_info, this);
252 255
253 return true; 256 return true;
254 } 257 }
255 258
256 void IpcPacketSocket::InitAcceptedTcp( 259 void IpcPacketSocket::InitAcceptedTcp(
257 P2PSocketClient* client, 260 P2PSocketClient* client,
258 const rtc::SocketAddress& local_address, 261 const rtc::SocketAddress& local_address,
259 const rtc::SocketAddress& remote_address) { 262 const rtc::SocketAddress& remote_address) {
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
664 } 667 }
665 668
666 rtc::AsyncResolverInterface* 669 rtc::AsyncResolverInterface*
667 IpcPacketSocketFactory::CreateAsyncResolver() { 670 IpcPacketSocketFactory::CreateAsyncResolver() {
668 scoped_ptr<AsyncAddressResolverImpl> resolver( 671 scoped_ptr<AsyncAddressResolverImpl> resolver(
669 new AsyncAddressResolverImpl(socket_dispatcher_)); 672 new AsyncAddressResolverImpl(socket_dispatcher_));
670 return resolver.release(); 673 return resolver.release();
671 } 674 }
672 675
673 } // namespace content 676 } // namespace content
OLDNEW
« 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