Lines Matching refs:uv
52 struct datauv *uv; member
56 struct datauv *uv) in create_curl_context() argument
63 context->uv = uv; in create_curl_context()
65 uv_poll_init_socket(uv->loop, &context->poll_handle, sockfd); in create_curl_context()
112 while((message = curl_multi_info_read(context->uv->multi, &pending))) { in check_multi_info()
126 curl_multi_remove_handle(context->uv->multi, easy_handle); in check_multi_info()
152 curl_multi_socket_action(context->uv->multi, context->sockfd, flags, in on_uv_socket()
163 curl_multi_socket_action(context->uv->multi, CURL_SOCKET_TIMEOUT, 0, in on_uv_timeout()
171 struct datauv *uv) in cb_timeout() argument
175 uv_timer_stop(&uv->timeout); in cb_timeout()
180 uv_timer_start(&uv->timeout, on_uv_timeout, timeout_ms, in cb_timeout()
188 struct datauv *uv, in cb_socket() argument
200 (curl_context_t *) socketp : create_curl_context(s, uv); in cb_socket()
202 curl_multi_assign(uv->multi, s, (void *) curl_context); in cb_socket()
215 curl_multi_assign(uv->multi, s, NULL); in cb_socket()
227 struct datauv uv = { 0 }; in main() local
235 uv.loop = uv_default_loop(); in main()
236 uv_timer_init(uv.loop, &uv.timeout); in main()
238 uv.multi = curl_multi_init(); in main()
239 curl_multi_setopt(uv.multi, CURLMOPT_SOCKETFUNCTION, cb_socket); in main()
240 curl_multi_setopt(uv.multi, CURLMOPT_SOCKETDATA, &uv); in main()
241 curl_multi_setopt(uv.multi, CURLMOPT_TIMERFUNCTION, cb_timeout); in main()
242 curl_multi_setopt(uv.multi, CURLMOPT_TIMERDATA, &uv); in main()
245 add_download(argv[argc], argc, uv.multi); in main()
249 curl_multi_socket_action(uv.multi, CURL_SOCKET_TIMEOUT, 0, &running_handles); in main()
250 uv_run(uv.loop, UV_RUN_DEFAULT); in main()
251 curl_multi_cleanup(uv.multi); in main()