| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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) |
| OLD | NEW |