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

Unified Diff: net/curvecp/curvecp_client_socket.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 | « net/curvecp/client_packetizer.cc ('k') | net/curvecp/curvecp_server_socket.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/curvecp/curvecp_client_socket.cc
diff --git a/net/curvecp/curvecp_client_socket.cc b/net/curvecp/curvecp_client_socket.cc
index 30bb378d76513a243293f30ef586a6f8bfc8d6d2..4aaea1b361ce7021eb22c2e9b1e5bf8a06af0e44 100644
--- a/net/curvecp/curvecp_client_socket.cc
+++ b/net/curvecp/curvecp_client_socket.cc
@@ -4,7 +4,6 @@
#include "net/base/ip_endpoint.h"
#include "net/base/net_errors.h"
-#include "net/base/sys_addrinfo.h"
#include "net/curvecp/curvecp_client_socket.h"
#include "net/curvecp/messenger.h"
@@ -47,17 +46,7 @@ int CurveCPClientSocket::GetPeerAddress(AddressList* address) const {
int rv = packetizer_.GetPeerAddress(&endpoint);
if (rv < 0)
return rv;
- struct sockaddr_storage sockaddr;
- size_t sockaddr_length = sizeof(sockaddr);
- bool success = endpoint.ToSockAddr(
- reinterpret_cast<struct sockaddr*>(&sockaddr), &sockaddr_length);
- if (!success)
- return ERR_FAILED;
- struct addrinfo ai;
- memset(&ai, 0, sizeof(ai));
- memcpy(&ai.ai_addr, &sockaddr, sockaddr_length);
- ai.ai_addrlen = sockaddr_length;
- *address = AddressList::CreateByCopying(&ai);
+ *address = AddressList(endpoint);
return OK;
}
« no previous file with comments | « net/curvecp/client_packetizer.cc ('k') | net/curvecp/curvecp_server_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698