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

Unified Diff: runtime/bin/socket_android.cc

Issue 59213003: Rename remoteHost to remoteAddress on *Socket. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Added mac/win/android versions. Created 7 years, 1 month 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 | « runtime/bin/socket.cc ('k') | runtime/bin/socket_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/socket_android.cc
diff --git a/runtime/bin/socket_android.cc b/runtime/bin/socket_android.cc
index 38c1c7f889d84941d39c3902036b60714a8b0ca5..02aed0bce9edc32d29c466aaa3047dd64c0335b4 100644
--- a/runtime/bin/socket_android.cc
+++ b/runtime/bin/socket_android.cc
@@ -136,7 +136,7 @@ intptr_t Socket::GetPort(intptr_t fd) {
}
-bool Socket::GetRemotePeer(intptr_t fd, char *host, intptr_t *port) {
+SocketAddress* Socket::GetRemotePeer(intptr_t fd, intptr_t* port) {
ASSERT(fd >= 0);
RawAddr raw;
socklen_t size = sizeof(raw);
@@ -148,23 +148,10 @@ bool Socket::GetRemotePeer(intptr_t fd, char *host, intptr_t *port) {
char error_message[kBufferSize];
strerror_r(errno, error_message, kBufferSize);
Log::PrintErr("Error getpeername: %s\n", error_message);
- return false;
- }
- if (TEMP_FAILURE_RETRY(getnameinfo(&raw.addr,
- size,
- host,
- INET6_ADDRSTRLEN,
- NULL,
- 0,
- NI_NUMERICHOST)) != 0) {
- const int kBufferSize = 1024;
- char error_message[kBufferSize];
- strerror_r(errno, error_message, kBufferSize);
- Log::PrintErr("Error getnameinfo: %s\n", error_message);
- return false;
+ return NULL;
}
*port = SocketAddress::GetAddrPort(&raw);
- return true;
+ return new SocketAddress(&raw.addr);
}
« no previous file with comments | « runtime/bin/socket.cc ('k') | runtime/bin/socket_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698