summaryrefslogtreecommitdiff
path: root/deps/uv/src/unix/getaddrinfo.c
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2012-12-13 20:23:01 +0100
committerBen Noordhuis <info@bnoordhuis.nl>2012-12-13 20:23:01 +0100
commit6cf68aead6886d397772ea176a9f5c35fdb63071 (patch)
treec9c650c69d13bb84000181b16834618069de4a79 /deps/uv/src/unix/getaddrinfo.c
parent0506d294dc5a51556e935a50a754aa7cbd7a7977 (diff)
downloadnode-6cf68aead6886d397772ea176a9f5c35fdb63071.tar.gz
deps: upgrade libuv to e079a99
Diffstat (limited to 'deps/uv/src/unix/getaddrinfo.c')
-rw-r--r--deps/uv/src/unix/getaddrinfo.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/deps/uv/src/unix/getaddrinfo.c b/deps/uv/src/unix/getaddrinfo.c
index d6bc69881..7f147291d 100644
--- a/deps/uv/src/unix/getaddrinfo.c
+++ b/deps/uv/src/unix/getaddrinfo.c
@@ -37,11 +37,16 @@ static void uv__getaddrinfo_work(struct uv__work* w) {
}
-static void uv__getaddrinfo_done(struct uv__work* w) {
+static void uv__getaddrinfo_done(struct uv__work* w, int status) {
uv_getaddrinfo_t* req = container_of(w, uv_getaddrinfo_t, work_req);
struct addrinfo *res = req->res;
#if __sun
- size_t hostlen = strlen(req->hostname);
+ size_t hostlen;
+
+ if (req->hostname)
+ hostlen = strlen(req->hostname);
+ else
+ hostlen = 0;
#endif
req->res = NULL;
@@ -58,6 +63,10 @@ static void uv__getaddrinfo_done(struct uv__work* w) {
else
assert(0);
+ req->hints = NULL;
+ req->service = NULL;
+ req->hostname = NULL;
+
if (req->retcode == 0) {
/* OK */
#if EAI_NODATA /* FreeBSD deprecated EAI_NODATA */
@@ -75,6 +84,12 @@ static void uv__getaddrinfo_done(struct uv__work* w) {
req->loop->last_err.sys_errno_ = req->retcode;
}
+ if (status == -UV_ECANCELED) {
+ assert(req->retcode == 0);
+ req->retcode = UV_ECANCELED;
+ uv__set_artificial_error(req->loop, UV_ECANCELED);
+ }
+
req->cb(req, req->retcode, res);
}