47 fprintf(stderr,
"Error opening %s\n",
filename);
51 CURL *
handle = curl_easy_init();
52 curl_easy_setopt(
handle, CURLOPT_WRITEDATA,
file);
53 curl_easy_setopt(
handle, CURLOPT_URL,
url);
55 fprintf(stderr,
"Added download %s -> %s\n",
url,
filename);
66 curl_easy_getinfo(
message->easy_handle, CURLINFO_EFFECTIVE_URL,
68 printf(
"%s DONE\n", done_url);
71 curl_easy_cleanup(
message->easy_handle);
75 fprintf(stderr,
"CURLMSG default\n");
99 curl_multi_socket_action(
curl_handle, CURL_SOCKET_TIMEOUT, 0, &running_handles);
111 if (
action == CURL_POLL_IN ||
action == CURL_POLL_OUT) {
117 curl_multi_assign(
curl_handle,
s, (
void *) curl_context);
128 case CURL_POLL_REMOVE:
148 if (curl_global_init(CURL_GLOBAL_ALL)) {
149 fprintf(stderr,
"Could not init cURL\n");
static mcore_handle handle
_Use_decl_annotations_ int __cdecl printf(const char *const _Format,...)
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec req
RZ_API void Ht_() free(HtName_(Ht) *ht)
int main(int argc, const char **argv)
void * malloc(size_t size)
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds const char struct utimbuf static buf static inc static sig const char static mode static oldfd struct tms static buf static getgid static geteuid const char static filename static arg static mask struct ustat static ubuf static getppid static setsid static egid sigset_t static set struct timeval struct timezone static tz fd_set fd_set fd_set struct timeval static timeout const char char static bufsiz const char static swapflags void static offset const char static length static mode static who const char struct statfs static buf unsigned unsigned num
static static fork const void static count static fd const char const char static newpath char char argv
static const char struct stat static buf struct stat static buf static vhangup int status
assert(limit<=UINT32_MAX/2)
static struct sockaddr static addrlen static backlog const void static flags void flags
void start_timeout(CURLM *multi, long timeout_ms, void *userp)
void check_multi_info(void)
void curl_close_cb(uv_handle_t *handle)
int handle_socket(CURL *easy, curl_socket_t s, int action, void *userp, void *socketp)
struct curl_context_s curl_context_t
void destroy_curl_context(curl_context_t *context)
void add_download(const char *url, int num)
void on_timeout(uv_timer_t *req)
void curl_perform(uv_poll_t *req, int status, int events)
curl_context_t * create_curl_context(curl_socket_t sockfd)
UV_EXTERN int uv_timer_start(uv_timer_t *handle, uv_timer_cb cb, uint64_t timeout, uint64_t repeat)
UV_EXTERN int uv_timer_init(uv_loop_t *, uv_timer_t *handle)
UV_EXTERN int uv_poll_start(uv_poll_t *handle, int events, uv_poll_cb cb)
UV_EXTERN int uv_run(uv_loop_t *, uv_run_mode mode)
UV_EXTERN int uv_timer_stop(uv_timer_t *handle)
UV_EXTERN void uv_close(uv_handle_t *handle, uv_close_cb close_cb)
UV_EXTERN int uv_poll_init_socket(uv_loop_t *loop, uv_poll_t *handle, uv_os_sock_t socket)
UV_EXTERN uv_loop_t * uv_default_loop(void)
UV_EXTERN int uv_poll_stop(uv_poll_t *handle)