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

Unified Diff: remoting/jingle_glue/ssl_socket_adapter.cc

Issue 10309002: Reimplements net::AddressList without struct addrinfo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: get_canonical_name -> canonical_name. iterator to indexing Created 8 years, 7 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 | « ppapi/shared_impl/private/ppb_host_resolver_shared.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/jingle_glue/ssl_socket_adapter.cc
diff --git a/remoting/jingle_glue/ssl_socket_adapter.cc b/remoting/jingle_glue/ssl_socket_adapter.cc
index 5966396736589ab9e57e204f9225b2973a53b5dd..b6b530dc5e367d45c54d90fb28ea8a9fe9097201 100644
--- a/remoting/jingle_glue/ssl_socket_adapter.cc
+++ b/remoting/jingle_glue/ssl_socket_adapter.cc
@@ -13,7 +13,6 @@
#include "net/base/host_port_pair.h"
#include "net/base/net_errors.h"
#include "net/base/ssl_config_service.h"
-#include "net/base/sys_addrinfo.h"
#include "net/socket/client_socket_factory.h"
#include "net/url_request/url_request_context.h"
@@ -220,21 +219,13 @@ bool TransportSocket::IsConnectedAndIdle() const {
int TransportSocket::GetPeerAddress(net::AddressList* address) const {
talk_base::SocketAddress socket_address = socket_->GetRemoteAddress();
-
- // libjingle supports only IPv4 addresses.
- sockaddr_in ipv4addr;
- socket_address.ToSockAddr(&ipv4addr);
-
- struct addrinfo ai;
- memset(&ai, 0, sizeof(ai));
- ai.ai_family = ipv4addr.sin_family;
- ai.ai_socktype = SOCK_STREAM;
- ai.ai_protocol = IPPROTO_TCP;
- ai.ai_addr = reinterpret_cast<struct sockaddr*>(&ipv4addr);
- ai.ai_addrlen = sizeof(ipv4addr);
-
- *address = net::AddressList::CreateByCopyingFirstAddress(&ai);
- return net::OK;
+ net::IPEndPoint endpoint;
+ if (jingle_glue::SocketAddressToIPEndPoint(socket_address, &endpoint)) {
+ *address = net::AddressList(endpoint);
+ return net::OK;
+ } else {
+ return net::ERR_FAILED;
+ }
}
int TransportSocket::GetLocalAddress(net::IPEndPoint* address) const {
« no previous file with comments | « ppapi/shared_impl/private/ppb_host_resolver_shared.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698