From: rui Date: Sat, 29 Jan 2011 22:46:23 +0000 (+0000) Subject: Support https and support some add some debugging messages. Also removed that FIXME... X-Git-Tag: build/2012-07-04.173327~1331 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=263ed3b994a7699d796753255f06f0ab79069f7d;p=profile%2Fivi%2Fecore.git 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: http://svn.enlightenment.org/svn/e/trunk/ecore@56390 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- 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;