镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 2 additions & 15 deletions src/cares_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -928,7 +928,7 @@ void AfterGetAddrInfo(uv_getaddrinfo_t* req, int status, struct addrinfo* res) {
char ip[INET6_ADDRSTRLEN];
const char *addr;

// Iterate over the IPv4 responses again this time creating javascript
// Iterate over the IPv4/IPv6 responses again this time creating javascript
// strings for each IP and filling the results array.
address = res;
while (address) {
Expand All @@ -950,20 +950,7 @@ void AfterGetAddrInfo(uv_getaddrinfo_t* req, int status, struct addrinfo* res) {
Local<String> s = OneByteString(env->isolate(), ip);
results->Set(n, s);
n++;
}

// Increment
address = address->ai_next;
}

// Iterate over the IPv6 responses putting them in the array.
address = res;
while (address) {
CHECK_EQ(address->ai_socktype, SOCK_STREAM);

// Ignore random ai_family types.
if (address->ai_family == AF_INET6) {
// Juggle pointers
} else if (address->ai_family == AF_INET6) {
addr = reinterpret_cast<char*>(&(reinterpret_cast<struct sockaddr_in6*>(
address->ai_addr)->sin6_addr));
int err = uv_inet_ntop(address->ai_family,
Expand Down