Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Commit 95eb729

Browse files
committed
Upgrade libuv to 3a50f8f
1 parent 236b217 commit 95eb729

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

deps/uv/src/win/getaddrinfo.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,14 @@ void uv_process_getaddrinfo_req(uv_loop_t* loop, uv_getaddrinfo_t* handle,
117117
struct addrinfo* addrinfo_ptr;
118118
char* alloc_ptr = NULL;
119119
char* cur_ptr = NULL;
120-
uv_err_code uv_ret;
120+
int status = 0;
121121

122122
/* release input parameter memory */
123123
if (handle->alloc != NULL) {
124124
free(handle->alloc);
125125
handle->alloc = NULL;
126126
}
127127

128-
uv_ret = uv_translate_eai_error(handle->retcode);
129128
if (handle->retcode == 0) {
130129
/* convert addrinfoW to addrinfo */
131130
/* first calculate required length */
@@ -136,7 +135,8 @@ void uv_process_getaddrinfo_req(uv_loop_t* loop, uv_getaddrinfo_t* handle,
136135
if (addrinfow_ptr->ai_canonname != NULL) {
137136
name_len = uv_utf16_to_utf8(addrinfow_ptr->ai_canonname, -1, NULL, 0);
138137
if (name_len == 0) {
139-
uv_ret = uv_translate_sys_error(GetLastError());
138+
uv__set_sys_error(loop, GetLastError());
139+
status = -1;
140140
goto complete;
141141
}
142142
addrinfo_len += ALIGNED_SIZE(name_len);
@@ -201,9 +201,13 @@ void uv_process_getaddrinfo_req(uv_loop_t* loop, uv_getaddrinfo_t* handle,
201201
}
202202
}
203203
} else {
204-
uv_ret = UV_ENOMEM;
204+
uv__set_artificial_error(loop, UV_ENOMEM);
205+
status = -1;
205206
}
206-
207+
} else {
208+
/* GetAddrInfo failed */
209+
uv__set_artificial_error(loop, uv_translate_eai_error(handle->retcode));
210+
status = -1;
207211
}
208212

209213
/* return memory to system */
@@ -214,7 +218,7 @@ void uv_process_getaddrinfo_req(uv_loop_t* loop, uv_getaddrinfo_t* handle,
214218

215219
complete:
216220
/* finally do callback with converted result */
217-
handle->getaddrinfo_cb(handle, uv_ret, (struct addrinfo*)alloc_ptr);
221+
handle->getaddrinfo_cb(handle, status, (struct addrinfo*)alloc_ptr);
218222

219223
uv_unref(loop);
220224
}

0 commit comments

Comments
 (0)