Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Upgrade libuv to 3a50f8f

  • Loading branch information...
commit 95eb729e6fff5c06ce2825381d9ed875be1b8508 1 parent 236b217
@piscisaureus piscisaureus authored
Showing with 10 additions and 6 deletions.
  1. +10 −6 deps/uv/src/win/getaddrinfo.c
View
16 deps/uv/src/win/getaddrinfo.c
@@ -117,7 +117,7 @@ void uv_process_getaddrinfo_req(uv_loop_t* loop, uv_getaddrinfo_t* handle,
struct addrinfo* addrinfo_ptr;
char* alloc_ptr = NULL;
char* cur_ptr = NULL;
- uv_err_code uv_ret;
+ int status = 0;
/* release input parameter memory */
if (handle->alloc != NULL) {
@@ -125,7 +125,6 @@ void uv_process_getaddrinfo_req(uv_loop_t* loop, uv_getaddrinfo_t* handle,
handle->alloc = NULL;
}
- uv_ret = uv_translate_eai_error(handle->retcode);
if (handle->retcode == 0) {
/* convert addrinfoW to addrinfo */
/* first calculate required length */
@@ -136,7 +135,8 @@ void uv_process_getaddrinfo_req(uv_loop_t* loop, uv_getaddrinfo_t* handle,
if (addrinfow_ptr->ai_canonname != NULL) {
name_len = uv_utf16_to_utf8(addrinfow_ptr->ai_canonname, -1, NULL, 0);
if (name_len == 0) {
- uv_ret = uv_translate_sys_error(GetLastError());
+ uv__set_sys_error(loop, GetLastError());
+ status = -1;
goto complete;
}
addrinfo_len += ALIGNED_SIZE(name_len);
@@ -201,9 +201,13 @@ void uv_process_getaddrinfo_req(uv_loop_t* loop, uv_getaddrinfo_t* handle,
}
}
} else {
- uv_ret = UV_ENOMEM;
+ uv__set_artificial_error(loop, UV_ENOMEM);
+ status = -1;
}
-
+ } else {
+ /* GetAddrInfo failed */
+ uv__set_artificial_error(loop, uv_translate_eai_error(handle->retcode));
+ status = -1;
}
/* return memory to system */
@@ -214,7 +218,7 @@ void uv_process_getaddrinfo_req(uv_loop_t* loop, uv_getaddrinfo_t* handle,
complete:
/* finally do callback with converted result */
- handle->getaddrinfo_cb(handle, uv_ret, (struct addrinfo*)alloc_ptr);
+ handle->getaddrinfo_cb(handle, status, (struct addrinfo*)alloc_ptr);
uv_unref(loop);
}
Please sign in to comment.
Something went wrong with that request. Please try again.