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

Unified Diff: runtime/bin/socket.cc

Issue 2665973003: Fix peer addresses being reported raw rather than the actual address byte. (Closed)
Patch Set: Add testcases Created 3 years, 11 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 | « no previous file | tests/standalone/io/socket_info_ipv4_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/socket.cc
diff --git a/runtime/bin/socket.cc b/runtime/bin/socket.cc
index cbb9a2c937d895dd251a0f1a85512065539e5565..0eb82beb7d4dbd49292eda9aaed6a25c702a81be 100644
--- a/runtime/bin/socket.cc
+++ b/runtime/bin/socket.cc
@@ -577,10 +577,7 @@ void FUNCTION_NAME(Socket_GetRemotePeer)(Dart_NativeArguments args) {
Dart_ListSetAt(entry, 1, Dart_NewStringFromCString(addr->as_string()));
RawAddr raw = addr->addr();
- intptr_t data_length = SocketAddress::GetInAddrLength(raw);
- Dart_Handle data = Dart_NewTypedData(Dart_TypedData_kUint8, data_length);
- Dart_ListSetAsBytes(data, 0, reinterpret_cast<uint8_t*>(&raw), data_length);
- Dart_ListSetAt(entry, 2, data);
+ Dart_ListSetAt(entry, 2, SocketAddress::ToTypedData(raw));
Dart_ListSetAt(list, 0, entry);
Dart_ListSetAt(list, 1, Dart_NewInteger(port));
« no previous file with comments | « no previous file | tests/standalone/io/socket_info_ipv4_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698