Lines Matching refs:req
99 uv_getaddrinfo_t* req; in uv__getaddrinfo_work() local
102 req = container_of(w, uv_getaddrinfo_t, work_req); in uv__getaddrinfo_work()
103 err = getaddrinfo(req->hostname, req->service, req->hints, &req->addrinfo); in uv__getaddrinfo_work()
104 req->retcode = uv__getaddrinfo_translate_error(err); in uv__getaddrinfo_work()
109 uv_getaddrinfo_t* req; in uv__getaddrinfo_done() local
111 req = container_of(w, uv_getaddrinfo_t, work_req); in uv__getaddrinfo_done()
112 uv__req_unregister(req->loop); in uv__getaddrinfo_done()
115 if (req->hints) in uv__getaddrinfo_done()
116 uv__free(req->hints); in uv__getaddrinfo_done()
117 else if (req->service) in uv__getaddrinfo_done()
118 uv__free(req->service); in uv__getaddrinfo_done()
119 else if (req->hostname) in uv__getaddrinfo_done()
120 uv__free(req->hostname); in uv__getaddrinfo_done()
124 req->hints = NULL; in uv__getaddrinfo_done()
125 req->service = NULL; in uv__getaddrinfo_done()
126 req->hostname = NULL; in uv__getaddrinfo_done()
129 assert(req->retcode == 0); in uv__getaddrinfo_done()
130 req->retcode = UV_EAI_CANCELED; in uv__getaddrinfo_done()
133 if (req->cb) in uv__getaddrinfo_done()
134 req->cb(req, req->retcode, req->addrinfo); in uv__getaddrinfo_done()
139 uv_getaddrinfo_t* req, in uv_getaddrinfo() argument
152 if (req == NULL || (hostname == NULL && service == NULL)) in uv_getaddrinfo()
180 uv__req_init(loop, req, UV_GETADDRINFO); in uv_getaddrinfo()
181 req->loop = loop; in uv_getaddrinfo()
182 req->cb = cb; in uv_getaddrinfo()
183 req->addrinfo = NULL; in uv_getaddrinfo()
184 req->hints = NULL; in uv_getaddrinfo()
185 req->service = NULL; in uv_getaddrinfo()
186 req->hostname = NULL; in uv_getaddrinfo()
187 req->retcode = 0; in uv_getaddrinfo()
193 req->hints = memcpy(buf + len, hints, sizeof(*hints)); in uv_getaddrinfo()
198 req->service = memcpy(buf + len, service, service_len); in uv_getaddrinfo()
203 req->hostname = memcpy(buf + len, hostname, hostname_len); in uv_getaddrinfo()
207 &req->work_req, in uv_getaddrinfo()
213 uv__getaddrinfo_work(&req->work_req); in uv_getaddrinfo()
214 uv__getaddrinfo_done(&req->work_req, 0); in uv_getaddrinfo()
215 return req->retcode; in uv_getaddrinfo()