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

Side by Side Diff: runtime/bin/socket_win.cc

Issue 17601011: Fix InternetAddress.resolve impl and test for Windows. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/standalone/io/internet_address_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/globals.h" 5 #include "platform/globals.h"
6 #if defined(TARGET_OS_WINDOWS) 6 #if defined(TARGET_OS_WINDOWS)
7 7
8 #include "bin/builtin.h" 8 #include "bin/builtin.h"
9 #include "bin/eventhandler.h" 9 #include "bin/eventhandler.h"
10 #include "bin/file.h" 10 #include "bin/file.h"
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 freeaddrinfo(info); 252 freeaddrinfo(info);
253 return addresses; 253 return addresses;
254 } 254 }
255 255
256 256
257 bool Socket::ReverseLookup(RawAddr addr, 257 bool Socket::ReverseLookup(RawAddr addr,
258 char* host, 258 char* host,
259 intptr_t host_len, 259 intptr_t host_len,
260 OSError** os_error) { 260 OSError** os_error) {
261 ASSERT(host_len >= NI_MAXHOST); 261 ASSERT(host_len >= NI_MAXHOST);
262 int status = TEMP_FAILURE_RETRY(getnameinfo( 262 int status = getnameinfo(&addr.addr,
263 &addr.addr, 263 SocketAddress::GetAddrLength(&addr),
264 SocketAddress::GetAddrLength(&addr), 264 host,
265 host, 265 host_len,
266 host_len, 266 NULL,
267 NULL, 267 0,
268 0, 268 NI_NAMEREQD);
269 NI_NAMEREQD));
270 if (status != 0) { 269 if (status != 0) {
271 ASSERT(*os_error == NULL); 270 ASSERT(*os_error == NULL);
272 DWORD error_code = WSAGetLastError(); 271 DWORD error_code = WSAGetLastError();
273 SetLastError(error_code); 272 SetLastError(error_code);
274 *os_error = new OSError(); 273 *os_error = new OSError();
275 return false; 274 return false;
276 } 275 }
277 return true; 276 return true;
278 } 277 }
279 278
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 IPPROTO_TCP, 423 IPPROTO_TCP,
425 TCP_NODELAY, 424 TCP_NODELAY,
426 reinterpret_cast<char *>(&on), 425 reinterpret_cast<char *>(&on),
427 sizeof(on)) == 0; 426 sizeof(on)) == 0;
428 } 427 }
429 428
430 } // namespace bin 429 } // namespace bin
431 } // namespace dart 430 } // namespace dart
432 431
433 #endif // defined(TARGET_OS_WINDOWS) 432 #endif // defined(TARGET_OS_WINDOWS)
OLDNEW
« no previous file with comments | « no previous file | tests/standalone/io/internet_address_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698