From 1f323b65894dbb6155acaee63fc5995ee5f3de0e Mon Sep 17 00:00:00 2001 From: rui Date: Sat, 29 Jan 2011 22:46:23 +0000 Subject: [PATCH] Support https and support some add some debugging messages. Also removed that FIXME as it's implemented in the case of linking with curl. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/ecore@56390 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/ecore_file/ecore_file_download.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/lib/ecore_file/ecore_file_download.c b/src/lib/ecore_file/ecore_file_download.c index 26433cd..4b0a294 100644 --- a/src/lib/ecore_file/ecore_file_download.c +++ b/src/lib/ecore_file/ecore_file_download.c @@ -125,13 +125,17 @@ ecore_file_download(const char *url, if (!ecore_file_is_dir(dir)) { + EINA_LOG_ERR("%s is not a directory", dir); free(dir); return EINA_FALSE; } free(dir); - if (ecore_file_exists(dst)) return EINA_FALSE; + if (ecore_file_exists(dst)) + { + EINA_LOG_ERR("Parent of %s, %s, is not a directory", dst, dir); + return EINA_FALSE; + } - /* FIXME: Add handlers for http and ftp! */ if (!strncmp(url, "file://", 7)) { /* FIXME: Maybe fork? Might take a while to copy. @@ -144,7 +148,7 @@ ecore_file_download(const char *url, return ecore_file_cp(url, dst); } # ifdef HAVE_CURL - else if ((!strncmp(url, "http://", 7)) || + else if ((!strncmp(url, "http://", 7)) || (!strncmp(url, "https://", 8)) || (!strncmp(url, "ftp://", 6))) { /* download */ @@ -152,10 +156,17 @@ ecore_file_download(const char *url, job = _ecore_file_download_curl(url, dst, completion_cb, progress_cb, data); if(job_ret) *job_ret = job; + if(job) + return EINA_TRUE; + else + { + EINA_LOG_ERR("no job returned\n"); + return EINA_FALSE; + } return job ? EINA_TRUE : EINA_FALSE; } # else - else if ((!strncmp(url, "http://", 7)) || + else if ((!strncmp(url, "http://", 7)) || (!strncmp(url, "https://", 8)) || (!strncmp(url, "ftp://", 6))) { (void)completion_cb; -- 2.7.4