forked from enlightenment/efl
Adding a function to abort all downloads.
SVN revision: 25634
This commit is contained in:
parent
7b44542ef9
commit
54c1f3e1ee
|
@ -102,6 +102,7 @@ extern "C" {
|
||||||
long int ultotal,
|
long int ultotal,
|
||||||
long int ulnow),
|
long int ulnow),
|
||||||
void *data);
|
void *data);
|
||||||
|
EAPI void ecore_file_download_abort_all(void);
|
||||||
EAPI int ecore_file_download_protocol_available(const char *protocol);
|
EAPI int ecore_file_download_protocol_available(const char *protocol);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -82,6 +82,29 @@ ecore_file_download_shutdown(void)
|
||||||
return init;
|
return init;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
ecore_file_download_abort_all(void)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_CURL
|
||||||
|
Ecore_File_Download_Job *job;
|
||||||
|
|
||||||
|
if (!_job_list)
|
||||||
|
return;
|
||||||
|
|
||||||
|
ecore_list_goto_first(_job_list);
|
||||||
|
while ((job = ecore_list_next(_job_list)))
|
||||||
|
{
|
||||||
|
ecore_main_fd_handler_del(job->fd_handler);
|
||||||
|
curl_multi_remove_handle(curlm, job->curl);
|
||||||
|
curl_easy_cleanup(job->curl);
|
||||||
|
fclose(job->file);
|
||||||
|
free(job->dst);
|
||||||
|
free(job);
|
||||||
|
}
|
||||||
|
ecore_list_clear(_job_list);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
EAPI int
|
EAPI int
|
||||||
ecore_file_download(const char *url, const char *dst,
|
ecore_file_download(const char *url, const char *dst,
|
||||||
void (*completion_cb)(void *data, const char *file, int status),
|
void (*completion_cb)(void *data, const char *file, int status),
|
||||||
|
|
Loading…
Reference in New Issue