| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2008 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2008 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 #include "webrtc/base/nethelpers.h" | 11 #include "webrtc/base/nethelpers.h" |
| 12 | 12 |
| 13 #include <memory> | 13 #include <memory> |
| 14 | 14 |
| 15 #if defined(WEBRTC_WIN) | 15 #if defined(WEBRTC_WIN) |
| 16 #include <ws2spi.h> | 16 #include <ws2spi.h> |
| 17 #include <ws2tcpip.h> | 17 #include <ws2tcpip.h> |
| 18 #include "webrtc/base/win32.h" | 18 #include "webrtc/base/win32.h" |
| 19 #endif | 19 #endif |
| 20 #if defined(WEBRTC_POSIX) && !defined(__native_client__) | 20 #if defined(WEBRTC_POSIX) && !defined(__native_client__) |
| 21 #if defined(WEBRTC_ANDROID) | 21 #if defined(WEBRTC_ANDROID) |
| 22 #include "webrtc/base/ifaddrs-android.h" | 22 #include "webrtc/base/ifaddrs-android.h" |
| 23 #else | 23 #else |
| 24 #include <ifaddrs.h> | 24 #include <ifaddrs.h> |
| 25 #endif | 25 #endif |
| 26 #endif // defined(WEBRTC_POSIX) && !defined(__native_client__) | 26 #endif // defined(WEBRTC_POSIX) && !defined(__native_client__) |
| 27 | 27 |
| 28 #include "webrtc/base/byteorder.h" | 28 #include "webrtc/base/byteorder.h" |
| 29 #include "webrtc/base/checks.h" |
| 29 #include "webrtc/base/logging.h" | 30 #include "webrtc/base/logging.h" |
| 30 #include "webrtc/base/signalthread.h" | 31 #include "webrtc/base/signalthread.h" |
| 31 | 32 |
| 32 namespace rtc { | 33 namespace rtc { |
| 33 | 34 |
| 34 int ResolveHostname(const std::string& hostname, int family, | 35 int ResolveHostname(const std::string& hostname, int family, |
| 35 std::vector<IPAddress>* addresses) { | 36 std::vector<IPAddress>* addresses) { |
| 36 #ifdef __native_client__ | 37 #ifdef __native_client__ |
| 37 ASSERT(false); | 38 RTC_NOTREACHED(); |
| 38 LOG(LS_WARNING) << "ResolveHostname() is not implemented for NaCl"; | 39 LOG(LS_WARNING) << "ResolveHostname() is not implemented for NaCl"; |
| 39 return -1; | 40 return -1; |
| 40 #else // __native_client__ | 41 #else // __native_client__ |
| 41 if (!addresses) { | 42 if (!addresses) { |
| 42 return -1; | 43 return -1; |
| 43 } | 44 } |
| 44 addresses->clear(); | 45 addresses->clear(); |
| 45 struct addrinfo* result = NULL; | 46 struct addrinfo* result = NULL; |
| 46 struct addrinfo hints = {0}; | 47 struct addrinfo hints = {0}; |
| 47 hints.ai_family = family; | 48 hints.ai_family = family; |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 break; | 190 break; |
| 190 } | 191 } |
| 191 } | 192 } |
| 192 freeifaddrs(ifa); | 193 freeifaddrs(ifa); |
| 193 return has_ipv6; | 194 return has_ipv6; |
| 194 #else | 195 #else |
| 195 return true; | 196 return true; |
| 196 #endif | 197 #endif |
| 197 } | 198 } |
| 198 } // namespace rtc | 199 } // namespace rtc |
| OLD | NEW |