Skip to content

Commit

Permalink
fix ipv6 resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Phillips committed Jun 11, 2012
1 parent 3f69e44 commit cb93157
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion deps/zlib
Submodule zlib updated 1 files
+0 −2 zlib.gyp
6 changes: 5 additions & 1 deletion src/luv_dns.c
Expand Up @@ -499,7 +499,11 @@ static void luv_dns_getaddrinfo_callback(uv_getaddrinfo_t* res, int status,

for (curr=start; curr; curr=curr->ai_next) {
if (curr->ai_family == AF_INET || curr->ai_family == AF_INET6) {
addr = (char*) &((struct sockaddr_in*) curr->ai_addr)->sin_addr;
if (curr->ai_family == AF_INET) {
addr = (char*) &((struct sockaddr_in*) curr->ai_addr)->sin_addr;
} else {
addr = (char*) &((struct sockaddr_in6*) curr->ai_addr)->sin6_addr;
}
uv_inet_ntop(curr->ai_family, addr, ip, INET6_ADDRSTRLEN);
lua_pushstring(ref->L, ip);
lua_rawseti(ref->L, -2, n++);
Expand Down

0 comments on commit cb93157

Please sign in to comment.