From 6cf68aead6886d397772ea176a9f5c35fdb63071 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Thu, 13 Dec 2012 20:23:01 +0100 Subject: deps: upgrade libuv to e079a99 --- deps/uv/src/unix/getaddrinfo.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'deps/uv/src/unix/getaddrinfo.c') 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); } -- cgit v1.2.1