OLD | NEW |
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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 // We need to send both resolved and unresolved address in Init. Unresolved | 244 // 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. | 245 // address will be used in case of TLS for certificate hostname matching. |
246 // Certificate will be tied to domain name not to IP address. | 246 // Certificate will be tied to domain name not to IP address. |
247 P2PHostAndIPEndPoint remote_info(remote_address.hostname(), remote_endpoint); | 247 std::string remote_hostname = remote_address.hostname() + ":" + |
| 248 remote_address.PortAsString(); |
| 249 P2PHostAndIPEndPoint remote_info(remote_hostname, remote_endpoint); |
248 | 250 |
249 client->Init(type, local_endpoint, remote_info, this); | 251 client->Init(type, local_endpoint, remote_info, this); |
250 | 252 |
251 return true; | 253 return true; |
252 } | 254 } |
253 | 255 |
254 void IpcPacketSocket::InitAcceptedTcp( | 256 void IpcPacketSocket::InitAcceptedTcp( |
255 P2PSocketClient* client, | 257 P2PSocketClient* client, |
256 const talk_base::SocketAddress& local_address, | 258 const talk_base::SocketAddress& local_address, |
257 const talk_base::SocketAddress& remote_address) { | 259 const talk_base::SocketAddress& remote_address) { |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
662 } | 664 } |
663 | 665 |
664 talk_base::AsyncResolverInterface* | 666 talk_base::AsyncResolverInterface* |
665 IpcPacketSocketFactory::CreateAsyncResolver() { | 667 IpcPacketSocketFactory::CreateAsyncResolver() { |
666 scoped_ptr<AsyncAddressResolverImpl> resolver( | 668 scoped_ptr<AsyncAddressResolverImpl> resolver( |
667 new AsyncAddressResolverImpl(socket_dispatcher_)); | 669 new AsyncAddressResolverImpl(socket_dispatcher_)); |
668 return resolver.release(); | 670 return resolver.release(); |
669 } | 671 } |
670 | 672 |
671 } // namespace content | 673 } // namespace content |
OLD | NEW |